search for: r38825

Displaying 3 results from an estimated 3 matches for "r38825".

Did you mean: 138825
2006 Aug 28
2
S4 classes and objects -- fixed structure? No...
Hello. Suppose you define a new S4-class, say > setClass("track", representation(x="numeric", y="numeric")) Don't worry if you have a deja vu, it's from the help page. Your new class is said to have a fixed structure: two slots, x, and y, and that should apply to all objects you construct as members of that class. > tr <- new( "track" )
2006 Aug 10
3
Is there a better way than x[1:length(x)-1] ?
Hi WizaRds, In MATLAB you can do x=1:10 and then specify x(2:end) to get 2 3 4 5 6 7 8 9 10 or whatever (note that in MATLAB the parenthetic index notation is used, not brackets as in R). The point is that 'end' allows you to refer to the final index point of the array. Obviously there isn't much gain in syntax when the variable name is x, but when it's something like
2006 Aug 18
5
as.data.frame(cbind()) transforming numeric to factor?
Dear List, why does as.data.frame(cbind()) transform numeric variables to factors, once one of the other variablesused is a character vector? # x.1 <- rnorm(10) x.2 <- c(rep("Test",10)) Foo <- as.data.frame(cbind(x.1)) is.factor(Foo$x.1) Foo <- as.data.frame(cbind(x.1,x.2)) is.factor(Foo$x.1) # I assume there is a good reason for this, can somebody explain? Thanks. Best,