Re: [R] TRUNCATED error with data frame
Try ?source: it is not an 'error'. max.deparse.length: integer; is used only if 'echo' is 'TRUE' and gives the maximal length of the printout of a single expression. So the 'echo' has been truncated at 150 characters, not the expression used. On Mon, 12 Nov 2007, apsawant wrote: Hi , I am new to R. I am trying to run a simple R script as shown below: aov.R -- data1-c(49,47,46,47,48,47,41,46,43,47,46,45,48,46,47,45,49,44,44,45,42,45,45,40 ,49,46,47,45,49,45,41,43,44,46,45,40,45,43,44,45,48,46,40,45,40,45,47,40) matrix(data1, ncol= 4, dimnames = list(paste(subj, 1:12), c(Shape1.Color1, Shape2.Color1, Shape1.Color2, Shape2.Color2))) Hays.df-data.frame(rt = data1, subj=factor(rep(paste(subj, 1:12, sep=), 4)), shape=factor(rep(rep(c(shape1,shape2), c(12, 12)), 2)), color=factor(rep(c(color1,color2), c(24, 24 I am getting the following error message: Output at the R prompt -- source(aov.R,echo=T) data1 - c(49, 47, 46, 47, 48, 47, 41, 46, 43, 47, 46, 45, 48, 46, 47, 45, 49, 44, 44, 45, 42, 45, 45, 40, 49, 46, 47, 45, 49, 45, 41, 43, 4 [TRUNCATED] matrix(data1, ncol = 4, dimnames = list(paste(subj, 1:12), c(Shape1.Color1, Shape2.Color1, Shape1.Color2, Shape2.Color2))) Shape1.Color1 Shape2.Color1 Shape1.Color2 Shape2.Color2 subj 1 49484945 subj 2 47464643 subj 3 46474744 subj 4 47454545 subj 5 48494948 subj 6 47444546 subj 7 41444140 subj 8 46454345 subj 9 43424440 subj 1047454645 subj 1146454547 subj 1245404040 Hays.df - data.frame(rt = data1, subj = factor(rep(paste(subj, 1:12, sep = ), 4)), shape = factor(rep(rep(c(shape1, shape2), c(12, [TRUNCATED] I would appreciate if anyone could point out as to why I am getting this TRUNCATED message. Eventually, I want to run the following command: aov(rt - shape * color + Error(subj/(shape * color)), data=Hays.df) summary(aov(rt - shape * color + Error(subj/(shape * color)), data=Hays.df)) Thanks, Amit. -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-help@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.
Re: [R] TRUNCATED error with data frame
Hi , I am trying to modify the same example script to calculate AOV. Below is the script file (aov.R) I am trying to execute: aov.R -- data1-c(49,47,46,47,48,47,41,46,43,47,46,45,48,46,47,45,49,44,44,45,42,45,45,40 ,49,46,47,45,49,45,41,43,44,46,45,40,45,43,44,45,48,46,40,45,40,45,47,40) matrix(data1, ncol= 4, dimnames = list(paste(subj, 1:12), c(Shape1.Color1, Shape2.Color1, Shape1.Color2, Shape2.Color2))) Hays.df-data.frame(rt = data1, subj=factor(rep(paste(subj, 1:12, sep=), 4)), shape=factor(rep(rep(c(shape1,shape2), c(12, 12)), 2)), color=factor(rep(c(color1,color2), c(24, 24 aov(rt - shape * color + Error(subj/(shape * color)), data=Hays.df) summary(aov(rt - shape * color + Error(subj/(shape * color)), data=Hays.df)) Here is the error I get: source(aov.R) Error in terms(formula, Error, data = data) : Object shape not found I would appreciate your help as to why I am getting this error message. Thanks, Amit. Prof Brian Ripley wrote: Try ?source: it is not an 'error'. max.deparse.length: integer; is used only if 'echo' is 'TRUE' and gives the maximal length of the printout of a single expression. So the 'echo' has been truncated at 150 characters, not the expression used. On Mon, 12 Nov 2007, apsawant wrote: Hi , I am new to R. I am trying to run a simple R script as shown below: aov.R -- data1-c(49,47,46,47,48,47,41,46,43,47,46,45,48,46,47,45,49,44,44,45,42,45,45,40 ,49,46,47,45,49,45,41,43,44,46,45,40,45,43,44,45,48,46,40,45,40,45,47,40) matrix(data1, ncol= 4, dimnames = list(paste(subj, 1:12), c(Shape1.Color1, Shape2.Color1, Shape1.Color2, Shape2.Color2))) Hays.df-data.frame(rt = data1, subj=factor(rep(paste(subj, 1:12, sep=), 4)), shape=factor(rep(rep(c(shape1,shape2), c(12, 12)), 2)), color=factor(rep(c(color1,color2), c(24, 24 I am getting the following error message: Output at the R prompt -- source(aov.R,echo=T) data1 - c(49, 47, 46, 47, 48, 47, 41, 46, 43, 47, 46, 45, 48, 46, 47, 45, 49, 44, 44, 45, 42, 45, 45, 40, 49, 46, 47, 45, 49, 45, 41, 43, 4 [TRUNCATED] matrix(data1, ncol = 4, dimnames = list(paste(subj, 1:12), c(Shape1.Color1, Shape2.Color1, Shape1.Color2, Shape2.Color2))) Shape1.Color1 Shape2.Color1 Shape1.Color2 Shape2.Color2 subj 1 49484945 subj 2 47464643 subj 3 46474744 subj 4 47454545 subj 5 48494948 subj 6 47444546 subj 7 41444140 subj 8 46454345 subj 9 43424440 subj 1047454645 subj 1146454547 subj 1245404040 Hays.df - data.frame(rt = data1, subj = factor(rep(paste(subj, 1:12, sep = ), 4)), shape = factor(rep(rep(c(shape1, shape2), c(12, [TRUNCATED] I would appreciate if anyone could point out as to why I am getting this TRUNCATED message. Eventually, I want to run the following command: aov(rt - shape * color + Error(subj/(shape * color)), data=Hays.df) summary(aov(rt - shape * color + Error(subj/(shape * color)), data=Hays.df)) Thanks, Amit. -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-help@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. -- View this message in context: http://www.nabble.com/TRUNCATED-error-with-data-frame-tf4795551.html#a13737252 Sent from the R help mailing list archive at Nabble.com. __ R-help@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.
Re: [R] TRUNCATED error with data frame
Hi Amit, Please read carefully the Mailing List Posting Guide (available at http://www.r-project.org/posting-guide.html). In particular, this section: For new subjects, compose a new message and include the '[EMAIL PROTECTED]' (or '[EMAIL PROTECTED]') address specifically. (Replying to an existing post and then changing the subject messes up the threading in the archives and in many people's mail readers.) About your question. You have a mistake in your model formula. The basic way to code a formula in R is by doing y ~ 'model', where y is your dependent variable and 'model'. Notice that '~' is not the same as '-'. For details, see ?formula, or read the manual titled An introduction to R that can be found here http://cran.r-project.org/manuals.html. Julian apsawant wrote: Hi , I am trying to modify the same example script to calculate AOV. Below is the script file (aov.R) I am trying to execute: aov.R -- data1-c(49,47,46,47,48,47,41,46,43,47,46,45,48,46,47,45,49,44,44,45,42,45,45,40 ,49,46,47,45,49,45,41,43,44,46,45,40,45,43,44,45,48,46,40,45,40,45,47,40) matrix(data1, ncol= 4, dimnames = list(paste(subj, 1:12), c(Shape1.Color1, Shape2.Color1, Shape1.Color2, Shape2.Color2))) Hays.df-data.frame(rt = data1, subj=factor(rep(paste(subj, 1:12, sep=), 4)), shape=factor(rep(rep(c(shape1,shape2), c(12, 12)), 2)), color=factor(rep(c(color1,color2), c(24, 24 aov(rt - shape * color + Error(subj/(shape * color)), data=Hays.df) summary(aov(rt - shape * color + Error(subj/(shape * color)), data=Hays.df)) Here is the error I get: source(aov.R) Error in terms(formula, Error, data = data) : Object shape not found I would appreciate your help as to why I am getting this error message. Thanks, Amit. Prof Brian Ripley wrote: Try ?source: it is not an 'error'. max.deparse.length: integer; is used only if 'echo' is 'TRUE' and gives the maximal length of the printout of a single expression. So the 'echo' has been truncated at 150 characters, not the expression used. On Mon, 12 Nov 2007, apsawant wrote: Hi , I am new to R. I am trying to run a simple R script as shown below: aov.R -- data1-c(49,47,46,47,48,47,41,46,43,47,46,45,48,46,47,45,49,44,44,45,42,45,45,40 ,49,46,47,45,49,45,41,43,44,46,45,40,45,43,44,45,48,46,40,45,40,45,47,40) matrix(data1, ncol= 4, dimnames = list(paste(subj, 1:12), c(Shape1.Color1, Shape2.Color1, Shape1.Color2, Shape2.Color2))) Hays.df-data.frame(rt = data1, subj=factor(rep(paste(subj, 1:12, sep=), 4)), shape=factor(rep(rep(c(shape1,shape2), c(12, 12)), 2)), color=factor(rep(c(color1,color2), c(24, 24 I am getting the following error message: Output at the R prompt -- source(aov.R,echo=T) data1 - c(49, 47, 46, 47, 48, 47, 41, 46, 43, 47, 46, 45, 48, 46, 47, 45, 49, 44, 44, 45, 42, 45, 45, 40, 49, 46, 47, 45, 49, 45, 41, 43, 4 [TRUNCATED] matrix(data1, ncol = 4, dimnames = list(paste(subj, 1:12), c(Shape1.Color1, Shape2.Color1, Shape1.Color2, Shape2.Color2))) Shape1.Color1 Shape2.Color1 Shape1.Color2 Shape2.Color2 subj 1 49484945 subj 2 47464643 subj 3 46474744 subj 4 47454545 subj 5 48494948 subj 6 47444546 subj 7 41444140 subj 8 46454345 subj 9 43424440 subj 1047454645 subj 1146454547 subj 1245404040 Hays.df - data.frame(rt = data1, subj = factor(rep(paste(subj, 1:12, sep = ), 4)), shape = factor(rep(rep(c(shape1, shape2), c(12, [TRUNCATED] I would appreciate if anyone could point out as to why I am getting this TRUNCATED message. Eventually, I want to run the following command: aov(rt - shape * color + Error(subj/(shape * color)), data=Hays.df) summary(aov(rt - shape * color + Error(subj/(shape * color)), data=Hays.df)) Thanks, Amit. -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ R-help@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