similar to: Save/Display R Work

Displaying 20 results from an estimated 20000 matches similar to: "Save/Display R Work"

2001 Aug 15
2
FORTRAN in R
Hi, Can anyone tell me what might cause this error message? Error in .Fortran("swallocate", as.double(mtx), as.double(wt), as.integer(n), : C/Fortran function name not in load table This occurs when I copied the Splus stepwise() function into R. I can source into R fine, but when I need to call that function on some dataset, I got the above error message. Platform
2001 Aug 25
2
Writing R Library
Hi there, I'm trying to write an R library (for Windows version) when I encountered this problem. I put in a dataset called mussels into a sub-folder, data (I saw this is how it is done in other libraries). However when I load the library in R and typed: data(mussels) it complains it cannot find the data set in the library. Everything else works fine (so far), am I missing something
2001 Mar 21
3
Output Files..
Hi, Somehow I forgot how to do this... Say I have a command that produced a 28 x 28 data matrix. How can I output the matrix into a txt file (rather than copy/paste the matrix)? Thanks... Kevin ------------------------------------------------- Ko-Kang Kevin Wang Statistical Analysis Division Leader Software Developers' Klub University of Auckland New Zealand
2003 Mar 26
2
ifelse()
Hi, I'm not sure if this can be done but.. I know that with ifelse() I can do something like: ifelse(x <= 3, 1, 2) to go through each element in my vector x, and if x_i <= 3 substitute the number with 1 else with 2. Essentially I'll get a vector with 2 levels. Can I tweak it so I can get 3-levels? For example: if(x <= 3) then 1 elseif(3 < x <= 4) then 2
2001 May 23
4
Matrix manipulation
Hi, Suppose I have a matrix with, say 12 columns. I would like to extract out column 2 ~ 8 and 11 ~ 12 then combine them together. I tried with success to extract out the columns by doing: foo <- test[,2:8] goo <- test[,11:12] However then I am having trouble combining foo and goo. Helps are appreciated! Cheers, Kevin ----------------------------------- Ko-Kang Kevin Wang
2002 Jan 09
3
Build R Packages (man)
Hi there, I'm trying to get the manual for an R package (that I'm creating) to work... Firstly, I created the *.Rd files (by following the instructions in "Writing R Extensions" and using prompt() in R, then edit the *.Rd files. I then copy them into the "pkg/man" directory as suggested by the manual. However when I load the library (successfully) in R, I cannot
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 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
2001 Mar 15
2
Alternative to list()
Hi, Suppose I have a dataset with 10 columns, let's call it "foo". Now if I want to extract out only column 2 ~ 8, then I know I can use either: foo[ ,2:8] or fooNew <- list( foo[ ,2:8] ) (Is there any other alternative, just out of curiosity?) But, if I only want, say, column 1, 4 and 7, I tried: fooNew <- list( x = foo[ ,1], y = foo[ ,4], z = foo[ , 7] )
2002 Apr 15
1
Re: Writting R Function
Hi, I think I found the problem. It lies in my Fortran program. Is there a way, after a DO loop, to make sure it does NOT return anything? Cheers, Kevin On Mon, 15 Apr 2002, Ko-Kang Kevin Wang wrote: > Date: Mon, 15 Apr 2002 17:27:20 +1200 (NZST) > From: Ko-Kang Kevin Wang <kwan022 at stat1.stat.auckland.ac.nz> > To: R Help <r-help at stat.math.ethz.ch> > Subject:
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
2001 Mar 16
2
apply()
Hi, I input this command on a data matrix: > apply( traffic, 2, function(z){z-mean(z)}) and got the following error messages: Error in sum(..., na.rm = na.rm) : invalid "mode" of argument Can anyone tell me what is wrong here? Running R1.2.2 on Windows ME. Cheers, Kevin ------------------------------------------------- Ko-Kang Kevin Wang Statistical Analysis Division
2002 Sep 18
2
More on list to data frame (was: Re: List to Data Frame
Hi, Now suppose I have just one list called FOO, which has 25 objects, e.g.: [[1]] 1 2 3 4 5 [[2]] 6 7 8 9 10 . . . And I want to do something like: FRED <- data.frame(cbind(unlist(FOO[[1]]), unlist(FOO[[2]]), # ... for all 25 subsets )) Is it possible to do this, without doing unlist(FOO[[i]]) 25
2001 Aug 14
1
loess() v.s. lowess()
Hi there, Just out of curious, is there any difference between loess() and lowess() in R (and Splus in fact). Which one is more often used? Thanks, Ko-Kang Wang ------------------------------------------------------------------------------ Ko-Kang Kevin Wang Statistical Analysis Division Leader Software Developers' Klub (SDK) University of Auckland New Zealand
2001 Aug 27
1
Compile from Source.
Hi, Can anyone tell me how I can compile R from source under Windows environemtn (I kind of know how to do it in a UNIX enviroment)? What I mean is, suppose I make some changes in the R base, or reorganising the libraries, and want to compile into a Setup.exe file (like the one located in CRAN), how should I do this? Many thanks in advance... Ko-Kang Wang
2001 Oct 15
1
An Introduction to R - LaTeX Code
Hi, I am interested in seeing the LaTeX version of R manuals (such as An Introduction to R), and I found from CRAN that: "The texinfo sources of the latest version of these documents are contained in every R source distribution (in the subdirectory doc/manual of the extracted archive). " However when I went into that directory I only found the pdf and html version. Are there any
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
2001 May 02
2
Export to File...
Hi, I've been reading the Data Import and Export manual (page 25 on Connection chapter) but somehow I can't manage to get what I want. I have a 28x28 distance matrix, which I would like to export to a file. What I did was something like: zz <- file("ex.data", "w") # open an output file connection cat( traffic.manDist, file = zz ) # traffic.manDist is my
2002 May 18
5
Length of a string
Hi, Suppose I have created something like this in R: foo <- "myfoo" and I want to find out the number of character in foo (in other words, R should return 5 since "myfoo" has 5 charactors. How can I do it? I tried: length(foo) but it returned 1. Cheers, Kevin ------------------------------------------------------------------------------ Ko-Kang Kevin Wang