Create Excel Files for All JIVE Features

knitr::opts_chunk$set(echo = TRUE)
# {r, results="hide"} - The chunks is run but all results are hidden. The code shows in the doc,  
# {r, include=FALSE} - the code is run but neither the code or the results are shown
# {r, echo=FLASE} - The code is not shown, but results are
# bug= colaus has some NA in newID column on 9660 with csv data but no part2summary
library(xlsx)   
library(knitr)

currentdir="/data/guow4/project0/GGIR/postGGIR/postGGIR_compile/postGGIR3.0/inst/extdata/example/afterGGIR"
studyname="Example"
setwd(currentdir) 

foutFN<-function(x,studyname) paste("part7a_",studyname,"_some_features_page",x,".csv",sep="")
outFN<-paste("part7b_",studyname,"_all_features_3.csv",sep="") 
outFN.anno<-paste("part7c_",studyname,"_all_features.xlsx",sep="")

Combine all features into one single excel file (r outFN.anno).

root<-c("1_features", "2_face_day_PCs",  "3_face_subject_PCs",  "4_denseFLMM_day_PCs", "5_denseFLMM_subject_PCs","6_all")  

feaFN<-system.file("template", "features.dictionary.xlsx", package = "postGGIR")  
system(paste("cat ",feaFN," > ",outFN.anno,sep=""))

for (i in 1:6){

if (i<=5) inFN<-foutFN(root[i],studyname) else inFN<-outFN 

d<-read.csv(inFN, header = TRUE,stringsAsFactors=F) 
print(paste( c(i,inFN,dim(d)),collapse="  "))
try(write.xlsx(d, file=outFN.anno, sheetName = root[i],   col.names = TRUE, row.names = FALSE,append=TRUE)) 
} 

How to run this?

cd /data/guow4/project0/GGIR/postGGIR/postGGIR_compile/postGGIR3.0/inst/extdata/example/afterGGIR
R -e "rmarkdown::render('part7c_Example_postGGIR_JIVE_3_excelReport.Rmd' )"



Try the postGGIR package in your browser

Any scripts or data that you put into this service are public.

postGGIR documentation built on Jan. 6, 2022, 5:08 p.m.