[R] WriteXLS error:Error in get(x, envir = envir) : variable names are limited to 256 bytes

David Winsemius dwinsemius at comcast.net
Fri Dec 10 23:02:43 CET 2010


On Dec 10, 2010, at 4:39 PM, Patrick McKann wrote:

> Hello all,
> I don't understand why this won't work.  I have entered:
>
> WriteXLS(alldata,'test.xls')

I have gotten tripped up by the argument syntax in WriteXLS myself,  
many times. Please check the help page for argument names and use  
them, especially paying attention to the fact that the first argument  
needs to be a character _vector_ (and I suspect that passing it a list  
may not qualify) and I always use the name for the Excel file  
argument. I suspect that this may work:

WriteXLS('alldata','test.xls')

-- 
David.

>
> and I get this error message:
>
> Error in get(x, envir = envir) : variable names are limited to 256  
> bytes.
>
> My variable names are not very long, and are accepted by write.csv.
>
> alldata is a list containing 4 dataframes, with each dataframe  
> having the
> the same variable names, which are:
>
>> names(avg8302)
> [1] "ID"            "cluster"       "rec.unit"      "int.hib"
> "yr.hib"        "yr0309.hib"    "int.hib.se"    "yr.hib.se"     "
> yr0309.hib.se" "int.cl"
> [11] "yr.cl"         "yr0309.cl"     "int.cl.se"     "yr.cl.se"      "
> yr0309.cl.se"  "int.ru"        "yr.ru"         "yr0309.ru"      
> "int.ru.se"
> "yr.ru.se"
> [21] "yr0309.ru.se"  "int.sp"        "yr.sp"         "yr0309.sp"     "
> int.sp.se"     "yr.sp.se"      "yr0309.sp.se"
>>
>
> Does anybody know how I can fix this?  Or another way to write a  
> multi-sheet
> xls?
>
> Thank you.
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list