similar to: ifelse()

Displaying 20 results from an estimated 7000 matches similar to: "ifelse()"

2003 Mar 26
2
Plotting K-M Curve when have several strata
Hi, If I have: foo <- survfit(y ~ x) where y is a survival object and x is a n-level factor. The documentation says when I plot(foo), the confidence intervals will not be plotted (which I guess is understandable as otherwise the plot will get really messy). I tried to plot with confidence intervals by using: plot(foo, conf.int = TRUE) and indeed the resulting plot is messy. However
2003 Nov 26
4
strptime Usage
Hi, I have a column in a dataframe in the form of: > as.vector(SLDATX[1:20]) [1] "1/6/1986" "1/17/1986" "2/2/1986" "2/4/1986" "2/4/1986" [6] "2/21/1986" "3/6/1986" "3/25/1986" "4/6/1986" "4/10/1986" [11] "4/23/1986" "4/30/1986" "5/8/1986"
2003 May 25
1
Example Data Set(s) for nnet, rpart
Hi, I'm doing a presentation on Neural Networks and Tree-Based Models in two weeks, at the moment I'm looking for a data set to use in the presentation. What I would like to use is a good old data, like the Iris data, that is already known by every statisticians. MASS4 uses the cpus data in Chapter 8.10 and the Cushing's syndrome in Chapter 12.4. These two data sets plus the
2003 May 19
2
To update() or not to update()?
Hi, Suppose I have: # Fit a base model d1.ph <- coxph(Surv(start, stop, event)~ ejec + diavol + score + smoking + beta + surg.done, data = data.frame(foo)) summary(update(d1.ph, . ~ . + td1)) summary(update(d1.ph, . ~ . + td2)) As I have many columns in my data frame, foo, called td's. e.g. td1, td2, td3, .... And I'd like to
2003 Apr 04
3
Sampling from a Data Frame
Hi, I've been looking through the documentation for sample(), but can only get it to work with vectors. Is it possible to sample from a dataframe? -- Cheers, Kevin ------------------------------------------------------------------------------ /* Time is the greatest teacher, unfortunately it kills its students */ -- Ko-Kang Kevin Wang Master of Science (MSc) Student SLC Tutor and Lab
2003 Apr 08
5
Help on smooth.spline?
Hey, R-listers I was recommended to try using smooth.spline function for estimating 2-Dimensinal curve given a data set. So will you please tell me where to get this R function? Or which package provides this function? Thanks for your point. Fred
2003 May 17
2
Regression tree
Hi everybody. I'm a new R user and i've been searching a tool for construction of regression tree... I found function "tree()" written by a certain Mr. Ripley, and seems to be just what i'm looking for, but when i try to use it in R replies me:"Object not found". So I was wandering if I should include one special library or something like that? Thanks a lot, ana
2003 Apr 06
1
Change cex.axis in biplot()
Hi, If I do something like: biplot(x, cex.axis = .7) then it will only change the font size for axis 1 and 2, but not 3 and 4. Is there a way to change the fonts on axis 3 and 4? -- Cheers, Kevin ------------------------------------------------------------------------------ /* Time is the greatest teacher, unfortunately it kills its students */ -- Ko-Kang Kevin Wang Master of Science
2003 Apr 23
1
Plotting Factors -- Sorting x-axis
Hi, Say I have a factor with 20-levels: 1, 2, 3, ..., 20, called foo. If I do plot(foo) it will draw a barplot. But the x-axis is sorted alphanumerically, i.e. 1, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 2, 3, ..., 9, which is not what I want. I'd like to x-axis to be in the order of 1 ~ 20 numerically. So, the question is, how do I change the order on the x-axis in this case? --
2003 May 22
1
Getting the Bootstrap Error Rate of QDA
Hi, What does this mean when I have something like: > qda.boot <- boot(train, qda.bootstrap, R = 500) Error in qda.default(structure(data.matrix(x), class = "matrix"), ...) : Rank deficiency in group M with my qda.bootstrap() looks something like: > qda.bootstrap <- function(data, index) { + boot.qda <- qda(x = data[index, 2:9], group = data[index, 1]) + qda.pred
2003 Nov 20
3
read.table(..)..Help?
Hallo, can someone please help me. I have a proplem reading a file with more that one rows. e.g I used the function: p<-read.table(file="FILENAME ", header=TRUE,sep=";") and later used the data.Frame() function. It functions when the file has only a row of variables. When I insert the second row I get an error message. How do I do this ===== ===================== Sylvie
2003 Jun 07
1
Extracting Numbers from MANOVA output
Hi, Suppose I have: > summary(manova(plank.man)) Df Pillai approx F num Df den Df Pr(>F) plankton.new[, 1] 1 0.5267 9.8316 6 53 2.849e-07 *** Residuals 58 --- Signif. codes: 0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1 My understanding is the MANOVA summary returns a list.
2003 Jun 10
1
Bootstraping with MANOVA
Hi, Does anyone know what the error message mean? > Boot2.Pillai <- function(x, ind) { + x <- as.matrix(x[,2:ncol(x)]) + boot.x <- as.factor(x[ind, 1]) + boot.man <- manova(x ~ boot.x) + summary(manova(boot.man))[[4]][[3]] + } > > man.res <- manova(as.matrix(pl.nosite) ~ + as.factor(plankton.new[,1]))$residuals > boot2.plank <-
2003 Apr 08
2
tree plot
Hello helpers I have this problem. When I plot a regression tree, some words are cutted in the figure. There is an attached file tree.ps to see what I'm saying. In the right figure some labels are cutted. How can I solve this problem? -- http://adsl.sapo.pt -------------- next part -------------- A non-text attachment was scrubbed... Name: tree.ps Type: application/postscript Size: 4743
2003 Jun 08
6
Basic question on applying a function to each row of a dataframe
Hi, I have a function foo(x,y) and a dataframe, DF, comprised of two vectors, x & w, as follows : x w 1 1 1 2 2 1 3 3 1 4 4 1 etc I would like to apply the function foo to each 'pair' within DF e.g foo(1,1), foo(2,1), foo(3,1) etc I have tried >apply(DF,foo) >apply(DF[,],foo) >apply(DF[DF$x,DF$w],foo) However, none of the above worked. Can anyone help ?
2003 Jun 01
1
Wording of "R Installation and Administration"
Hi, I hope I haven't got this wrong, but I don't think one needs Perl installed if they install the "precompiled" packages for Windows right? I'm just wondering if the first sentence in the "R Installation and Administration" can be re-worded a bit so newbies won't get confused.... ---------- Forwarded message ---------- Date: Mon, 2 Jun 2003 08:56:37 +1200
2003 Nov 13
3
Program Saving
Hi, I have a very simple question. If a want to save a whole program (say more than 5 command lines), how can I proceed without each time using the command history (that allow me to recall previously saved command, but which is to long if you want to recall more than 5 command lines), or without saving to a text file and use copy/paste when I open a new R session (but in fact this doesn't
2003 Apr 11
4
Can I improve the efficiency of my scan() command?
Hi, Suppose I use the following codes to read in a data set. ############################################### > rating <- scan("../Data/Rating.csv", + what = list( + usage = "", + mileage = 0, + sex = "", + excess = "", + ncd = "", +
2003 Nov 17
3
S Programming
Dear all, I am thinking of writing my own functions in s-plus (or in R). I just know how to work with S-plus / R built-in functions. Therefore, I'm a beginner in S programming. I am looking for some on-line documentation that is well written about "Programming in S language" where control stuctures / loops / vectorization and necessery sequences of S programming are
2003 Dec 15
3
Julian Dates
Hi, I'm a bit confused how julian() works. If I understand right, it returns the number of days since the origin. I have a vector: > SLDATX[1:10] [1] "1986-01-06" "1986-01-17" "1986-02-02" "1986-02-04" [5] "1986-02-04" "1986-02-21" "1986-03-06" "1986-03-25" [9] "1986-04-06"