Hello, "in" is a reserved word.
?Reserved Hope this clarifies, Pascal 2013/7/11 jpm miao <[email protected]> > Hi, > > I have a matrix whose columns are named as "in" and "out". Then I coerce > it to be a data.frame. However the system seems to forbid me from using the > name "in", but I am not aware of it until I call it by the dollar sign $. > Is there something R should remind me but it does not? > Is there any remedy to work on it? > > > head(dat1$in) > Error: unexpected 'in' in "head(dat1$in" > > View(dat1) > > head(dat1["in"]) > in > 1 3.28 > 2 9.6 > 3 7.24 > 4 4.45 > 5 2.33 > 6 2.83 > > head(dat1["out"]) > out > 1 0 > 2 0 > 3 0.04 > 4 0.03 > 5 0.04 > 6 0.01 > > head(dat1$out) > [1] 0 0 0.04 0.03 0.04 0.01 > > [[alternative HTML version deleted]] > > ______________________________________________ > [email protected] 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. > [[alternative HTML version deleted]] ______________________________________________ [email protected] 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.

