Skip to content

Commit

Permalink
🐛 Fix data type
Browse files Browse the repository at this point in the history
  • Loading branch information
NONONOexe committed Oct 7, 2024
1 parent 3b1c131 commit 9f9975e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
13 changes: 5 additions & 8 deletions R/post-process.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,6 @@ post_process_main <- function(data) {
accident_data$latitude <- convert_deg(accident_data$latitude)
accident_data$longitude <- convert_deg(accident_data$longitude)

# Convert to sf object
accident_data_sf <- st_as_sf(
accident_data,
coords = c("longitude", "latitude"),
crs = 4326
)

# Filter person data
filter_person_data <- function(data, tag, suf) {
person_data <- filter_data_by_tag(data, tag)
Expand All @@ -74,7 +67,11 @@ post_process_main <- function(data) {

# Combine process data
processed_data <- list(
accident = cbind(key_data, accident_data_sf),
accident = st_as_sf(
cbind(key_data, accident_data),
coords = c("longitude", "latitude"),
crs = 4326
),
person = rbind(
cbind(key_data, person_a_data),
cbind(key_data, person_b_data)
Expand Down
2 changes: 1 addition & 1 deletion R/read-accident-data.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ read_accident_data <- function(

# Add attributes and class
attr(accident_data, "dataset_name") <- dataset_name
class(accident_data) <- c("accident_data", "data.frame")
class(accident_data) <- c("accident_data", class(accident_data))

# Apply post-processing if provided
if (is.function(post_process)) {
Expand Down

0 comments on commit 9f9975e

Please sign in to comment.