fork(1) download
  1. # your code goes here
  2. install.packages("jsonlite")
  3. install.packages("reshape2")
  4.  
  5. #讀進json line檔並轉成dataframe
  6. library(jsonlite)
  7. src <- paste0(readLines("C:/Users/Amy/Desktop/Market json/P11.json"),collapse = ',')
  8. x <- fromJSON(src,flatten = TRUE)
  9. j <- as.data.frame(x)
  10.  
  11. #整理data#
  12. library(reshape2)
  13. j.pc <- subset(j,test.pc!="NULL")
  14.  
  15. #中間有一長串整理此data的code#
  16.  
  17. #檔案輸出#
  18. write.csv(dat, file = "p11")
Success #stdin #stdout #stderr 0.23s 60752KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
Warning in install.packages("jsonlite") :
  'lib = "/usr/local/lib/R/site-library"' is not writable
Error in install.packages("jsonlite") : unable to install packages
Execution halted