Diff for "FAQ/Ratomic" - CBU statistics Wiki
location: Diff for "FAQ/Ratomic"
Differences between revisions 2 and 3
Revision 2 as of 2009-06-10 12:19:07
Size: 655
Editor: PeterWatson
Comment:
Revision 3 as of 2009-06-10 12:19:31
Size: 671
Editor: PeterWatson
Comment:
Deletions are marked like this. Additions are marked like this.
Line 15: Line 15:
This advice is taken from [https://stat.ethz.ch/pipermail/r-help/2008-November/179050.html here.] This advice is presented in fuller detail [https://stat.ethz.ch/pipermail/r-help/2008-November/179050.html here.]

An Error caused by using an inappropriate data type in R - and its solution

Using some versions of R (2.8 and 2.9) you sometimes get the mystifying error message "$ operator is invalid for atomic vectors" . This can happen even if the R code you are running worked in earlier versions.

This may be due to inputting data as matrix data rather than a dataframe in R. You can so this conversion easily using the command as.data.frame.

% matrix data
b=matrix(a,3,2,byrow=T)
% converted to dataframe format
c=as.data.frame(b)

This advice is presented in fuller detail [https://stat.ethz.ch/pipermail/r-help/2008-November/179050.html here.]

None: FAQ/Ratomic (last edited 2013-03-08 10:17:16 by localhost)