fastICA in R (Extracting the Components) -
i'm new r. run analysis in sas. however, need use fastica in r.
i've conducted independent component analysis in r , looking extract actual components.
the code i've used follows:
ica<-fastica(final_all_truncated_s, n.comp = 100)
ica
list 5 elements "x" "k" "w" "a" "s"
i extract values these elements, save excel file, , import sas. question is, how extract values these elements can export excel file?
rather saving results excel format, recommend saving each component of result separate csv file.
this way don't need additional packages, , have software-independent file format can read sas, excel, etc.
you can achieve using simple for-loop in r, e.g.:
for (x in names(ica)) { write.csv(ica[[x]], file=sprintf('%s.csv', x), row.names=false, quote=false) }
here, names(ica)
returns vector of list indices ("x", "k", "w", "a", , "s").
we iterate on indices, extract corresponding list entries, , write csv file same name + ".csv", containing entry list.
you might consider spending little time working in r see if can achieve want in environment since capable of of same kinds of analyses sas.
Comments
Post a Comment