excel - Get multiline utf-8 data (2900 columns) from R into SPSS -
is there failsafe way data cells containing multiline utf8 text many columns r spss? preferably conserved types.
if csv, may not have tried transferring 2700 columns occasional cell containing multiline text , utf8 characters. seems impossible.
- spss fails if there occasional cell containing several lines (will see several cases,
delcasedoesn't fix , requires know number of columns). - openoffice handle charset , multilines can't handle many columns.
- excel can deal many columns. open comma-separated files, not tab-separated files correctly default, botches diacritics. if use import-feature fix utf-8 botches multi-line text.
- spss fails if there occasional cell containing several lines (will see several cases,
if
xlsx::write.xlsx: works, takes excruciatingly long (10m) , before spss eat generated xlsx files, have manually open , resave them in excel (i haven't yet found out spss doesn't them, thinks they're single column).i haven't tried setting database , using rmysql + odbc in excel or spss yet, because seemed bit overkill then. doesn't seem overkill in comparison anymore, doubt odbc should in excel or spss. proven way?
edit: in reply comment suggesting foreign::writeforeign:
writeforeign doesn't save .sav directly, saves csv file write.table(dfn, file = datafile, row.names = false, col.names = false, sep = ",", quote = false, na = "", eol = ",\n") , generates .sps files import.
it fails original data because variable names exceed 8 chars (and duplicate names through truncation, not surprising 2700 vars. spss can deal using routes described). if use subset designed exhibit known pitfalls, fails "cannot handle character variables longer 255", wouldn't surprised if failed multi-line character input in general too, because spss doesn't seem able deal during csv import.
i still haven't gone odbc route, because xlsx package works better expected.
to fix java.lang.outofmemoryerror: java heap space error you'll large tables, used options( java.parameters = "-xmx3g" ) (before xlsx library loaded).
that said, i'm still looking answer doesn't involve manually resaving excel document.
Comments
Post a Comment