R json解析
library(jsonlite)
ch1 <- fromJSON('/mnt/c/Users/xuefliang/Desktop/622921201605302722(1).txt')
ch2 <- fromJSON('/mnt/c/Users/xuefliang/Desktop/622927202110102510(1).txt')
ch3 <- fromJSON('/mnt/c/Users/xuefliang/Desktop/622921202303047214(1).txt')
ch4 <- fromJSON('/mnt/c/Users/xuefliang/Desktop/622921202403302112(1).txt')
ch5 <- fromJSON('/mnt/c/Users/xuefliang/Desktop/622921202403011825(1).txt')
person1 <- as_tibble(ch1$data$PersonInfoList)
person2 <- as_tibble(ch2$data$PersonInfoList)
person3 <- as_tibble(ch3$data$PersonInfoList)
person4 <- as_tibble(ch4$data$PersonInfoList)
person5 <- as_tibble(ch5$data$PersonInfoList)
person <- bind_rows(person1,person2,person3,person4,person5)
vaccination <- person %>%
unnest(VaccinationInfoList) %>%
mutate(EntryDate=ymd_hms(EntryDate),UpdateDate=ymd_hms(UpdateDate),UplodeDate=ymd_hms(UplodeDate)) %>%
mutate(scjs = case_when(
difftime(UplodeDate, EntryDate, units = "hours") <= 24 ~ "是",
TRUE ~ "否"
),xgjs=case_when(difftime(UplodeDate, UpdateDate, units = "hours") <= 24 ~ "是",
TRUE ~ "否"))
评论
发表评论