[R] numerical or not?
John Kane
jrkrideau at yahoo.ca
Tue Apr 27 00:20:48 CEST 2010
I don't seem to be able to duplicate the problem. Using your read.table command I get a data.frame (which is of course a type of list) and something like sum(dat1[,1] gives me a numerical result.
What variable is giving you the not numerical error message
--- On Mon, 4/26/10, Laetitia Schmid <laetitia at gmt.su.se> wrote:
> From: Laetitia Schmid <laetitia at gmt.su.se>
> Subject: [R] numerical or not?
> To: r-help at r-project.org
> Received: Monday, April 26, 2010, 5:19 PM
> Hi,
> I've had a little problem for several weeks now. It is
> annoying and
> therefore I will ask for help:
> When I write a script with several iterations, I make it
> write out a
> text file to save the data during the run. For example I
> write:
> if (i %% 25) write.table(output,"temporary_output.txt")
> Later on, when I read in this output and want to calculate
> things, R
> complains that x is not numeric.
> I read it in with the following command:
> dat1<-read.table("temporary_output.txt",header=TRUE).
> It seems that R is saving my temporary output as a list.
> What is wrong here? And how can I do it better?
>
> This time I attached the temporary_output.txt:
>
>
>
>
> Thanks.
> Laetitia
> -----Inline Attachment Follows-----
>
> ______________________________________________
> 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