[R] Limitations on R code file

guox at ucalgary.ca guox at ucalgary.ca
Thu May 6 20:26:22 CEST 2010


Thanks, Jorge.
Yes, I can also run the code.
But I would like to know the limitations on the lengths of variable names,
formulas/equations, and files.
Steve has pointed out a limitation on the length of a variable name is
256kb. So

abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz0123456789012345678901
<- 1

is OK and

abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz0123456789012345678901
+
abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz0123456789012345678902

OK too as long as both are claimed.
Any ideas on lengths of formulas/equations?

-james
> Hi James,
>
> I ran all your code on a fresh R session (64 bit, OS X 10.6.0) and got no
> errors. I suspect what Steve suggests is true:  your computer is running
> out
> of memory. Have you tried running it on a 64 bit machine?
>
> Here is my sessionInfo():
>
> R version 2.11.0 (2010-04-22)
> x86_64-apple-darwin9.8.0
>
> locale:
> [1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8
>
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
>
> loaded via a namespace (and not attached):
> [1] grid_2.11.0    lattice_0.18-5 tools_2.11.0
>
>
> HTH,
> Jorge
>
>
> On Wed, May 5, 2010 at 5:28 PM, <> wrote:
>
>> I would like to run R code from a file that is generated from other
>> source.
>> The file consists of some variables and formulas/equations such as
>>
>> Variables = log(100)
>> ##Other variable definitions
>> VariablesWithLongNames = 2*3*log(12345678)+10^4 + Variables
>> Equations=log(VariablesWithLongNames)+Variables^2
>> ##Other equations, formulas
>> Result = Equations^2+rnorm(10000)
>> hist(Result,breaks=100,freq=FALSE)
>> lines(density(Result),col = "blue")
>>
>> The file may be very long and some variable names may be very long too.
>> We know that objects > 100Mb can cause R to run out of memory. Not sure
>> if there are any other limitations on variable length and source file
>> length.
>> So my question is
>>
>> what are the limitations of variable name length and the source file
>> length
>> in R?
>>
>> Could you please drop a few lines or point me know where I can find
>> them?
>> Thanks,
>>
>> -james
>>
>> ______________________________________________
>> 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.
>>
>



More information about the R-help mailing list