similar to: Duplicate rows of matrix

Displaying 20 results from an estimated 5000 matches similar to: "Duplicate rows of matrix"

2007 Dec 11
5
book on regular expressions
Hello, Could someone recommend a good book on regular expressions with focus on applications/use as it might relate to R. I remember there was a mention of such a reference book recently, but I could not locate that message on the archive. Thanks. -Christos Christos Hatzis, Ph.D. Nuvera Biosciences, Inc. 400 West Cummings Park Suite 5350 Woburn, MA 01801 Tel: 781-938-3830
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
2007 Aug 02
1
sapply?
I have to compare four different grape varieties proteome in two different years. I don't know what test would be more suitable for my data. I think that an anova two way can be usefull also if someone suggested me to perform a manova. In addiction, I can perform each test on a single protein a time, but I can't loose my whole life carrying out anova (I have more than 1000 protein to
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 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
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 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.
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 Jul 11
3
3D plot and interactive PDFs
With version 8 of acrobat reader, it is now possible to have 3D in PDf documents. Does it exist already an R package who manage to produce 3D plots which can be saved as interactive 3D graphs in a PDF file? Best Regards Bruno Cavestro ------------------------------------------------------ Leggi GRATIS le tue mail con il telefonino i-mode? di Wind http://i-mode.wind.it/
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 Mar 15
2
how to...
I have to perform ANOVA's on many different data organized in a dataframe. I can run an ANOVA for each sample, but I've got hundreds of data and I would like to avoid manually carrying out each test. in addition, I would like to have the results organized in a simple way, for example in a table, wich could be easy to export. thank you for assistance simone
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
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
2007 Apr 20
3
sequences extraction
Hello, I need to extract sequences from an ordered vector. For example, if a<-c(1,2,3,6,10,11,13) I need to get the followings 4 vectors (1,2,3),(6),(10,11),(13) Thank You -Bruno ------------------------------------------------------ Leggi GRATIS le tue mail con il telefonino i-mode? di Wind http://i-mode.wind.it/
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
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