Hi all, A small problem raising. Suppose the follow raw data is stored in a csv file. And the error is coming as NULL with the following code. Can you please help? Thank you in advance. SUBJCET 9999 9999 9999 9999 9999 1Ito 1Ito 1Ito 1Ito 1Ito 1Ito 9999 9999 9999 9999 read.csv("Noname3.csv") -> FD FD$SUBJECT NULL Regards Devarayalu [[alternative HTML version deleted]]
There's no column in FD named SUBJECT In your example data it's named SUBJCET, not the same. It's also possible that R didn't automatically recognize the first row as column names, and you need to add header=TRUE to the read.csv() command. In either case, you can see the actual column names of your data frame with: colnames(FD) Sarah On Mon, Jan 23, 2012 at 8:11 AM, Sri krishna Devarayalu Balanagu <balanagudevarayulu at gvkbio.com> wrote:> Hi all, > > A small problem raising. > Suppose the follow raw data is stored in a csv file. ?And the error is coming as NULL with the following code. > Can you please help? > Thank you in advance. > > SUBJCET > > 9999 > > 9999 > > 9999 > > 9999 > > 9999 > > 1Ito > > 1Ito > > 1Ito > > 1Ito > > 1Ito > > 1Ito > > 9999 > > 9999 > > 9999 > > 9999 > > > read.csv("Noname3.csv") -> FD > FD$SUBJECT > NULL > > Regards > Devarayalu >-- Sarah Goslee http://www.functionaldiversity.org
On 12-01-23 8:11 AM, Sri krishna Devarayalu Balanagu wrote:> Hi all, > > A small problem raising. > Suppose the follow raw data is stored in a csv file. And the error is coming as NULL with the following code. > Can you please help? > Thank you in advance. > > SUBJCETYou have a typo in the heading line. Duncan Murdoch> > 9999 > > 9999 > > 9999 > > 9999 > > 9999 > > 1Ito > > 1Ito > > 1Ito > > 1Ito > > 1Ito > > 1Ito > > 9999 > > 9999 > > 9999 > > 9999 > > > read.csv("Noname3.csv") -> FD > FD$SUBJECT > NULL > > Regards > Devarayalu > > > [[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.
Hi All, This is the file which I want to import into R After importing and querying the data, error is coming as null. read.csv("Noname3.csv", header=T) -> FD FD$SUBJECT NULL Can please help? Regards Devarayalu
On Tue, Jan 24, 2012 at 12:07:26PM +0000, Sri krishna Devarayalu Balanagu wrote:> > Hi All, > > This is the file which I want to import into R After importing and querying the data, error is coming as null. > > read.csv("Noname3.csv", header=T) -> FD > FD$SUBJECT > NULLHi. Names of the columns are case sensitive. The above means that there is no column SUBJECT, however, there may be column Subject or subject. Use names(FD) to see this. Hope this helps. Petr Savicky.