Has anyone written code to expand the JSON columns in R without installing the GitHub SafeGraphR?

Hi - has anyone written code to expand the JSON columns in R without installing the GitHub SafeGraphR package? I cannot install the SafeGraphR package on the university remote server so unfortunately I cannot use the expand_cat_json and expand_integer_json functions. I am trying to vertically expand the visits_by_day variable to generate visits to POIs by day of week.

Take a look at how @Nick_H-K_Seattle_University wrote the function:SafeGraphR/expand_json.R at master · SafeGraphInc/SafeGraphR · GitHub. If your server has data.table, you should be able to implement.

Also, @Derek_Ouyang_Stanford shared some really helpful functions here that can be used for expanding the JSON columns, as well as normalizing the data: covid19

thanks for calling this out @Yashaswini_Singh_Hopkins we should have new solution that will be helpful shortly

Just a note that one can usually install R packages as “user” packages, even on servers that are managed by someone else. You might want to check in with your server admin to get help if you get stuck.

This is very helpful. Thanks all. I’m curious if these data are representative at the daily observation level. When we expand the weekly patterns data to daily, does that affect the validity of the sampling methodology?

It’s just as representative as the weekly. Definitely noisier though. Most of the time, daily data is presented with a 7 day moving average for that reason.