similar to: book on regular expressions

Displaying 20 results from an estimated 3000 matches similar to: "book on regular expressions"

2006 Dec 04
2
Library file for the R engine in Windows?
Hi, I am trying to use dynamic memory allocation in the C code to be called by R through the .C interface. I have used R_alloc as explained in the Writing R Extensions and included the R.h header. The program compiles fine but fails when linking. Obviously it needs a library file where R_alloc is found. I have tried to link by adding R.dll to list of files at the end of the link command but
2006 Dec 24
2
how to 'get' an object that is part of a list
This might be an trivial thing but I am stuck. Consider: xx <- list(a=1:5, b=letters[1:5]) Although object xx is accessible through its name, how can object xx$b be accessed similarly through its name? > get("xx") $a [1] 1 2 3 4 5 $b [1] "a" "b" "c" "d" "e" > get("xx$b") Error in get(x, envir, mode, inherits)
2007 May 16
2
'attach workspace' on R console File menu
Quite often I save misc functions and data objects as .RData files that I can use in other sessions. Although I could 'Load Workspace" these files, most of the times I prefer attaching them. It would be really convenient to have a menu item under the File menu on the Windows R Console to allow attaching workspaces, e.g. -------------------- Attach Workspace... Load Workspace... Save
2007 Feb 01
3
Lining up x-y datasets based on values of x
Hi, I was wondering if there is a direct approach for lining up 2-column matrices according to the values of the first column. An example and a brute-force approach is given below: x <- cbind(1:10, runif(10)) y <- cbind(5:14, runif(10)) z <- cbind((-4):5, runif(10)) xx <- seq( min(c(x[,1],y[,1],z[,1])), max(c(x[,1],y[,1],z[,1])), 1) w <- cbind(xx, matrix(rep(0, 3*length(xx)),
2006 Oct 24
2
Plotmath expression
Hello, I've been trying to plot a subscript in a text formula using plotmath but I haven't been able to do so. In my example below I would like the text label to show X[min] = 10.1 +/- 5.5 Here is the code: ll <- c(x=10.1, sde=5.5) plot(1:10) text(x=9, y=2, pos=2, expression(paste(X[min], "=", paste(ll, collapse="+/-")))) This works fine up to the inner paste
2007 Feb 07
2
blank upper or lower triangle of cor-matrix
Dear altogether, I want to blank the lower (or upper) part of a correlation matrix as it is done by dist() example: ( d <- cor(matrix(runif(12),nrow=4)) ) If I do the following d[lower.tri(d)] <- "" of course everything is changed to character - that's not what should be. Additionally, it does not work to assign "0" or anything else. The same is true for
2006 Dec 03
1
passing matrix as argument to a C function
Hi, Although this is not directly an R-related question, it is relevant as I am trying to port some R code to C to speed things up in a computation. I am working through my first attempts to generate and link compiled C code in R. I could make the 'convolve' function to work and similar functions that take vectors as arguments. In my application I need to pass a couple of matrices to
2006 Nov 20
2
predict.coxph
Hi everyone, Can anyone give me more details about the 'lp', 'risk', 'terms', and 'expected' options from the predict.coxph function? I actually found that risk is obtained from exp(lp). I can't find information on 'expected' type however. Is anybody can expand the information on this function? Thank you in advance, I will appreciate it.
2009 Sep 10
1
importing/loading package without a namespace
I am developing a package that imports some functions from another package. The imported package (qcc) does not have a namespace and this is causing problems with loading of my package, which has a namespace. Is there a workaround to allow loading the namespace-less package? I searched the archives and found a suggestion that the package should be included in the Depends list, but this has not
2007 Apr 26
2
Extract p-value from survdiff function
Hi list, I want to use the p-value from the survdiff function (package survival) to reuse within a function in a Kaplan-Meier plot. The p-value is somehow not a component of the value list ?! Thanks in advance -- A. Goralczyk G?ttingen, Ger.
2007 Feb 01
1
Loading functions in R
Hi all, This information must be out there, but I can't seem to find it. What I want to do is to store functions I've created (as .R files or in whatever form) and then load them when I need them (or on startup) so that I can access without cluttering my program with the function code. This seems like it should be easy, but.... Thanks! Jeff
2007 Feb 02
1
Adding Histograms to Leaves of Rpart Tree or other Dendrogram
Hi - I'm trying to append simple density histograms of a continuous variable to the leaves of an rpart tree. The splits in the tree are all levels of a factor and I'm hoping to make the histograms out of the subsets of the dataframe corresponding to the splits and for them to be attached to the appropriate leaf of the final tree. Any help would be much appreciated, thanks, Jon Zelner
2007 Oct 09
1
Visualize cox proportional hazards
Hello all I would like to visualize the hazard ratios of a cox proportional hazards model. I have seen some good examples in the New England Journal of Medicine: http://content.nejm.org/cgi/content/short/353/26/2747/F3 http://content.nejm.org/cgi/content/short/350/26/2654/F2 (I hope these are open access, but I am not sure) And something similar in the book 'R Graphics' by Paul
2006 Jul 18
1
bilinear regression
I think this is an easy question, but I would be grateful for any advice on how to implement this in R. I simply have a response variable (y) that I am trying to predict with one explanatory variable (x) but the shape of the scatter plot is distinctly bilinear. It would be best described by two straight lines. Is there a way of fitting a linear model to give me a bilinear fit and (more
2007 Mar 09
2
Duplicate rows of matrix
Hello my problem is the following: I have a matrix A and a vector B which contains as many rows as A. I need to build a matrix C which contains B[i]-times the row A[i,] and this for each line of A. if for example A is [1] [2] [1] 8 9.4 [2] 4.2 1.1 and B is (3,1). Then C will be: [1] [2] [1] 8 9.4 [2] 8 9.4 [3] 8 9.4 [4] 4.2 1.1 I have some
2006 Mar 07
1
breslow estimator for cumulative hazard function
Dear R-users, I am checking the proportional hazard assumption of a cox model for a given covariate, let say Z1, after adjusting for other relavent covariates in the model. To this end, I fitted cox model stratified on the discrete values of Z1 and try to get beslow estimator for the baseline cumulative hazard function (H(t)) in each stratum. As far as i know, if the proportionality assumption
2007 Jan 20
4
simple q: returning a logical vector of substring matches
I'm a relative R novice, and sometimes the simple things trip me up. Suppose I have a <- c("apple", "pear") and I want a logical vector of whether each of these strings contains "ear" (in this case, F T). What is the idiom? Quizzically, Mark Lindeman
2007 Mar 03
3
Help with paste()
Dear r-helpers, Could you please tell me what's missing: rbind(paste('txt.est',1:24, sep = '')) txt.est1, ... txt.est24 are vectors that I wish to rbind. _____________________________ Professor Michael Kubovy University of Virginia Department of Psychology USPS: P.O.Box 400400 Charlottesville, VA 22904-4400 Parcels: Room 102 Gilmer Hall McCormick Road
2007 May 02
3
the Surv function
Hi, I'm trying to do a simple survival analysis on some data, and I'm having the following problem (here's my code and the error message): out <- Surv(fup,event=status) Error in Surv(fup, event = status) : argument "time2" is missing, with no default >From reading the documentation, it seems that I should be able to simply write: Surv(time1, event) if my data is
2006 Nov 16
3
X-fold cross validation function for discriminant analysis
Hi all, I ran a discriminant analysis with some data and want to get a general idea of prediction error rate. Some have suggested using X-fold cross validation procedure. Anyone know if there is a function for this in R? Thanks, Wade [[alternative HTML version deleted]]