[R] problem with all/all.equal

2011-04-06 Thread Laura Smith
Hi! In a function, I may have an instance in which all elements are equal. x - rep(1,5) x [1] 1 1 1 1 1 identical(x) Error in .Internal(identical(x, y, num.eq, single.NA, attrib.as.set)) : 'y' is missing all.equal(x) Error in is.expression(x) : 'x' is missing I don't care what

[R] PERT/CPM on R

2011-04-04 Thread Laura Smith
Hi! I was wondering if PERT or CPM was implemented in R. I looked in the search engines but didn't find anything. Since there are so many packages, I thought I'd double check via the discussion. Thanks, Laura. [[alternative HTML version deleted]]

[R] Finding the name vector

2011-03-14 Thread Laura Smith
Hello: Here are some basic class items: x - 1:10 class(x) [1] integer x.mat - matrix(1:6,nrow=2) class(x.mat) [1] matrix class(x3) [1] logical test - function() { plot(1:10) } class(test) [1] function Is there something that says vector, please? Or does it go to numeric, logical, or

[R] using initialize or using a constructor function

2011-03-13 Thread Laura Smith
Hi I'm trying to learn about S4 methods, classes, etc. Is it better to use initialize or use a construction function, please? Thank you. Laura Smith [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https

[R] now S4 classes and packages

2011-02-22 Thread Laura Smith
Hi again List: This time I have the following: setClass(dog,representation(breed=numeric)) [1] dog woof - function(x=1:10) { + if(!is.numeric(x))stop(Must have numeric data) + y - new(dog,breed=x) + return(y) + } setMethod(plot,dog, + function(x,y,...) { + plot(x@breed,col=blue,type=l) + } + )

[R] S3 classes and building a package

2011-02-21 Thread Laura Smith
Hi List! Suppose I have the following, please: setClass(buzz,representation(x=numeric),S3methods=TRUE) [1] buzz x - rnorm(10) class(x) - buzz plot.buzz - function(x,y,...) { + plot.default(x,type=l,col=blue) + } f - function(x) { + return(x^2) + }

[R] newbie Question on Generic and Method

2011-02-08 Thread Laura Smith
Hi! Here is a newbie question, please: what is the difference between a generic and a method? Thanks, Laura [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

[R] [OT] BLUE vs. BLUP

2011-02-04 Thread Laura Smith
Hi! Does anyone have a numeric example for calculating BLUE and BLUP, please? Thanks, Laura [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

[R] newbie question on str output

2010-12-16 Thread Laura Smith
Hi! Here is some output from an str command: str(CO2) Classes ‘nfnGroupedData’, ‘nfGroupedData’, ‘groupedData’ and 'data.frame': 84 obs. of 5 variables: $ Plant: Ord.factor w/ 12 levels Qn1Qn2Qn3..: 1 1 1 1 1 1 1 2 2 2 ... $ Type : Factor w/ 2 levels Quebec,Mississippi: 1 1 1 1