Skip to content

Commit

Permalink
tolower then factor, order is important to prevent char conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
kemihak committed Nov 13, 2024
1 parent 8f50418 commit 269d511
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions R/importOutput.R
Original file line number Diff line number Diff line change
Expand Up @@ -334,10 +334,9 @@

cols_to_factor_lower <- c("area", "link", "cluster")
cols_to_factor_lower <- intersect(cols_to_factor_lower, res_cols)
res[,(cols_to_factor_lower):=lapply(.SD, as.factor), .SDcols=cols_to_factor_lower]

#To remove when endpoint will not send uppercase anymore
res[,(cols_to_factor_lower):=lapply(.SD, tolower), .SDcols=cols_to_factor_lower]
res[,(cols_to_factor_lower):=lapply(.SD, as.factor), .SDcols=cols_to_factor_lower]

cols_to_integer <- c("timeId")
cols_to_integer <- intersect(cols_to_integer, res_cols)
Expand Down

0 comments on commit 269d511

Please sign in to comment.