管道%>;%在R
我想使用TIDYVERSE/PURRR中的管道%>%,使其更具可读性:管道%>;%在R,r,tidyverse,R,Tidyverse,我想使用TIDYVERSE/PURRR中的管道%>%,使其更具可读性: myChargingDevices<-data.frame(fromJSON(jsonFile)) myChargingDevices<-myChargingDevices %>% mutate(myTime=ymd_hms(lastUpdateCheck)) myChargingDevices<-myChargingDevices[order(myChargingDevices$myTime,
myChargingDevices<-data.frame(fromJSON(jsonFile))
myChargingDevices<-myChargingDevices %>%
mutate(myTime=ymd_hms(lastUpdateCheck))
myChargingDevices<-myChargingDevices[order(myChargingDevices$myTime,decreasing = TRUE),]
myChargingDevices$lastUpdateCheck<-NULL
myChargingDevices像这样:
myChargingDevices <- jsonFile %>%
fromJSON %>%
data.frame %>%
mutate(myTime = ymd_hms(lastUpdateCheck)) %>%
arrange(desc(myTime)) %>%
select(-lastUpdateCheck)
myChargingDevices%
fromJSON%>%
data.frame%>%
突变(myTime=ymd_hms(lastUpdateCheck))%>%
排列(描述(myTime))%>%
选择(-lastUpdateCheck)
我无法测试它,因为您没有提供可复制的代码。好主意。你试过什么了?问题很模糊,你如何决定什么是最方便的解决方案/答案?你能举一个可复制的例子吗fromJSON
和其他给定对象不是默认的R对象我正在搜索!