tidyr
Changing Million/Billion abbreviations into actual numbers? ie. 5.12M -> 5,120,000 [duplicate]
You can try this num <- c(“1.23M”, “15.69B”, “123.999M”) num <- gsub(‘B’, ‘e9’, num) num <- gsub(‘M’, ‘e6’, num) format(as.numeric(num), scientific = FALSE, big.mark = “,”) “84,060,000” “30,120,000,000” “251,290,000”
data.table equivalent of tidyr::complete()
I reckon that the philosophy of data.table entails fewer specially-named functions for tasks than you’ll find in the tidyverse, so some extra coding is required, like: res = setDT(df)[ CJ(person = person, observation_id = observation_id, unique=TRUE), on=.(person, observation_id) ] After this, you still have to manually handle the filling of values for missing levels. We … Read more