Re: [R] Ordering a matrix based on cluster no

2011-06-26 Thread Aparna Sampath
Thanks for the help! But when I tried it, it does not work the same way I want. :( after combining the two matrices, they look like this: V1V2 X TEL.AML1.C41 Hyperdip.50.C23 1 TEL.AML1.C41 1TEL.AML1.C41 1.000 0.

[R] Extracting certain text using tm package

2011-06-26 Thread vioravis
I have used "tm" package to import a set of text documents using the following command: text <- Corpus(DirSource("."),readerControl = list(language ="ansi")) I would like to extract only a certain portion of the text in each document using certain keywords. For example, I would like to include al

Re: [R] bwplot questions: box order, axis breaks, and multiple y-axis labels

2011-06-26 Thread Deepayan Sarkar
On Mon, Jun 27, 2011 at 2:35 AM, Saalem Adera wrote: > Hi all, > > I used bwplot in lattice to create a 6-panel boxplot grouped by a > conditioning variable (param) that displays concentration (conc) in > response to treatment (trtmnt).  Here is the functional part of my > code followed by my thre

Re: [R] changing graphs in qqplot2

2011-06-26 Thread Ista Zahn
Hi On Sun, Jun 26, 2011 at 4:21 PM, Sigrid wrote: > This is what I have now so far. > > p=ggplot(data = test, aes(x = YEAR, y = TOTAL, colour = TREATMENT)) + > geom_point() + geom_smooth(method = "lm", se=FALSE) + facet_wrap(~COUNTRY) >> p +scale_x_continuous(limits=c(1,4)) > > http://r.789695.n4

[R] Errors when installing RSPerl-0.92

2011-06-26 Thread Hunter Moseley
Hello, I am having errors when I try to install RSPerl-0.92 under fedora 14. I have the following rpms installed: R-devel-2.13.0-1.fc14.x86_64 R-core-2.13.0-1.fc14.x86_64 perl-5.12.3-143.fc14.x86_64 perl-devel-5.12.3-143.fc14.x86_64 perl-ExtUtils-* (all of them from yum) Now I get the following e

Re: [R] Fw:

2011-06-26 Thread Steven Kennedy
You can find the volcano script (along with a lot of others) at the following site: http://addictedtor.free.fr/graphiques/thumbs.php On Mon, Jun 27, 2011 at 11:49 AM, Jorge Ivan Velez wrote: > Hi Ungku, > > Check > > ?persp > ?volcano > > in the R console. > > HTH, > Jorge > > > On Sun, Jun 26,

Re: [R] Plotting a gragh or histogram in a certain colour

2011-06-26 Thread Steven Kennedy
plot(1:20,col='blue') On Mon, Jun 27, 2011 at 9:40 AM, wrote: > Dear Sir, > > Just started using R. I want to plot x>-1:20, for example, in the colour > blue. How do I do this? > > Regards, > > Ivo > >        [[alternative HTML version deleted]] > >

Re: [R] Fw:

2011-06-26 Thread Jorge Ivan Velez
Hi Ungku, Check ?persp ?volcano in the R console. HTH, Jorge On Sun, Jun 26, 2011 at 9:22 PM, Ungku Akashah <> wrote: > > > > - Forwarded Message - > From: Ungku Akashah <> > To: "r-help@r-project.org" <> > Sent: Friday, June 24, 2011 3:15 PM > Subject: > > > hello. > I need some hel

[R] (no subject)

2011-06-26 Thread Ungku Akashah
hello. I need some help about this R software. I've been searching for volcano plot(statistic) script for long, but still not found. May i request the script for volcano plot. If able, pls include any tips about volcano plot. thank you. [[alternative HTML version deleted]] ___

[R] Fw:

2011-06-26 Thread Ungku Akashah
- Forwarded Message - From: Ungku Akashah To: "r-help@r-project.org" Sent: Friday, June 24, 2011 3:15 PM Subject: hello. I need some help about this R software. I've been searching for volcano plot script for long, but still not found. May i request the script for volcano plot. If

[R] Plotting a gragh or histogram in a certain colour

2011-06-26 Thread Gwanmesia
Dear Sir, Just started using R. I want to plot x>-1:20, for example, in the colour blue. How do I do this? Regards, Ivo [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-hel

[R] Estimate zero inflated mixed model parameter

2011-06-26 Thread xqzhang85
Hi, I can not estimate the zero inflated mixed model parameters successfully. If it is possible, would you please help me write the code? In my case, I consider the location as a random effect. My data are: location y x1 x2 x3 1 1 1 2 2 2 3 3 3 Thank you very much. Yours, Xiongqing ___

[R] Fw:

2011-06-26 Thread Ungku Akashah
- Forwarded Message - From: Ungku Akashah To: "r-help@r-project.org" Sent: Friday, June 24, 2011 3:15 PM Subject: hi dear R crew. may i request the script for volcano plot. if able, pls include any tips about volcano plot. thank you. [[alternative HTML version deleted]] _

[R] Kernel Density Estimation at manually specified points

2011-06-26 Thread Carsten Harlaß
Hello, my name is Carsten. This ist my first post to R-help mailing list. I estimate densities with the function "density" out of the package "stats". A simplified example: #generation of test data n=10 z = rnorm(n) #density estimation f

Re: [R] Issue with dataset inclusion in CRAN packages

2011-06-26 Thread csrabak
Em 26/6/2011 17:43, Frank Harrell escreveu: I was glad to see the new rpart.plot package by Stephen Milborrow. I was however a bit concerned that Stephen distributed a dataset I created, and renamed the dataset (from titanic3 to ptitanic) in the process [with some justification, as some variable

Re: [R] RJDBC and multiple classpaths

2011-06-26 Thread Orvalho Augusto
My ignorance! I managed to connect doing: library(RJDBC) cp <- c( "/opt/DbVisualizer-7.1.1/jdbc/mdb/log4j.jar", "/opt/DbVisualizer-7.1.1/jdbc/mdb/commons_lang.jar", "/opt/DbVisualizer-7.1.1/jdbc/mdb/commons_logging.jar" ) .jinit(classpath=cp) drv <- JDBC("jstels.jdbc.mdb.MDBDriver", "/opt/DbVisu

Re: [R] how to extract data from a function printout - example provided

2011-06-26 Thread Ana Kolar
Oh. Fantastic! Many thanks for this, Sarah! Have a great week! Ana > >From: Sarah Goslee >To: Ana Kolar ; r-help >Sent: Sunday, 26 June 2011, 17:06 >Subject: Re: [R] how to extract data from a function printout - example >provided > >summary(m.out) is a list

Re: [R] [SOLVED] Only one strip with italic font.

2011-06-26 Thread Kenneth Roy Cabrera Torres
Thank you very much! That was exactly what I need! The answer was not obvious as I thought. El dom, 26-06-2011 a las 14:36 -0700, Peter Ehlers escribió: > On 2011-06-26 11:33, Kenneth Roy Cabrera Torres wrote: > > Hi R users: > > > > How can I obtain an italic font only > > for one of the two st

Re: [R] Accessing variables in a data frame

2011-06-26 Thread Bill.Venables
Just to start things off: > var.name <- c("gdp","inf","unp") > var.id <- c("w","i") > > x <- paste(var.name, rep(var.id, each=length(var.name)), sep="_") > x [1] "gdp_w" "inf_w" "unp_w" "gdp_i" "inf_i" "unp_i" > Now the three differences: gdp_w - gdp_i inf_w - inf_i unp_w - unp_i Can be got u

Re: [R] Only one strip with italic font.

2011-06-26 Thread Peter Ehlers
On 2011-06-26 11:33, Kenneth Roy Cabrera Torres wrote: Hi R users: How can I obtain an italic font only for one of the two strips in a xyplot? library(lattice) t<-rep(seq(0,10,5),4) logCFU<-c(2,2.5,3,4,4.5,1.5,2,2.5,3,3.4,2,2.5) microorg<-factor(rep(c("E. coli","L. monocytogenes"),each=6)) trat

Re: [R] Issue with dataset inclusion in CRAN packages

2011-06-26 Thread Frank Harrell
I was wrong about this. The dataset is small. Most of the space is taken up by a nice tutorial on rpart.plot. Still I would favor linking to datasets rather than duplicating part of them. Thanks Frank Frank Harrell wrote: > > I was glad to see the new rpart.plot package by Stephen Milborrow.

[R] bwplot questions: box order, axis breaks, and multiple y-axis labels

2011-06-26 Thread Saalem Adera
Hi all, I used bwplot in lattice to create a 6-panel boxplot grouped by a conditioning variable (param) that displays concentration (conc) in response to treatment (trtmnt). Here is the functional part of my code followed by my three questions: library(lattice); ww<-read.csv(file="c:/Rdata/latti

Re: [R] download R Package for HP-UX ia64 server

2011-06-26 Thread David Winsemius
On Jun 26, 2011, at 1:10 PM, Zhou, Hong wrote: Hi, I am new to R. Is there a R package for HP-UX Itanium 64 bits server available? Questions about obscure Unix systems generally get directed to the r- devel mailing list. I'm assuming you are asking if it is possible to compile R from so

[R] Issue with dataset inclusion in CRAN packages

2011-06-26 Thread Frank Harrell
I was glad to see the new rpart.plot package by Stephen Milborrow. I was however a bit concerned that Stephen distributed a dataset I created, and renamed the dataset (from titanic3 to ptitanic) in the process [with some justification, as some variables were omitted]. Fortunately Stephen included

[R] changing graphs in qqplot2

2011-06-26 Thread Sigrid
This is what I have now so far. p=ggplot(data = test, aes(x = YEAR, y = TOTAL, colour = TREATMENT)) + geom_point() + geom_smooth(method = "lm", se=FALSE) + facet_wrap(~COUNTRY) > p +scale_x_continuous(limits=c(1,4)) http://r.789695.n4.nabble.com/file/n3626510/graph.gif I would also like to: 1

Re: [R] What does class "call" mean? How do I make class "formula" into a "call"?

2011-06-26 Thread peter dalgaard
On Jun 26, 2011, at 00:10 , David Winsemius wrote: > > On Jun 25, 2011, at 4:33 PM, peter dalgaard wrote: > " >> >> I.e., an unevaluated formulae expression (as in quote(y~x)) is class "call", >> as is an unclassed formula object. So it is pretty easy to have objects of >> class "formula" ver

Re: [R] [R-sig-ME] Help with lmer

2011-06-26 Thread Iker Vaquero Alba
I´m not an expert either, but from my own experience with those annoying messages, I can suggest you some precautions you should take: - First of all, make sure, in your ".txt" file, that you are using dots for separating decimals, NOT commas. - Before writing your model, test each o

[R] download R Package for HP-UX ia64 server

2011-06-26 Thread Zhou, Hong
Hi, I am new to R. Is there a R package for HP-UX Itanium 64 bits server available? Thanks very much for your help! Hong Hong Zhou, MS, MIS Senior Systems Analyst Center for Outcomes Research The Children's Hospital of Philadelphia 3535 Market St. Suite 1029 Philadelphia, PA 10104 Tel: (215) 59

[R] sampling from the multivariate truncated normal

2011-06-26 Thread statfan
I am trying generate a sample for a truncated multivariate normal distribution via the rtmvnorm function in the {tmvtnorm} package. Why does the following produce NaNs? rtmvnorm(1, mean = rep(0, 2), matrix(c(0.06906084, -0.07463565, -0.07463565, 0.08078086),2),c(-0.4316738, 0.8283240), c(Inf,

Re: [R] Help with lmer

2011-06-26 Thread Hugo Mildenberger
Sophie, sorry for any possibly duplicate email, my email client currently does not work correctly. I understand this snapshot as being a subset of your data only. But I do miss the factor "Sitename", which appears in your lmer model as a random factor. Also, by looking at the subset, "Presenceb

[R] Only one strip with italic font.

2011-06-26 Thread Kenneth Roy Cabrera Torres
Hi R users: How can I obtain an italic font only for one of the two strips in a xyplot? library(lattice) t<-rep(seq(0,10,5),4) logCFU<-c(2,2.5,3,4,4.5,1.5,2,2.5,3,3.4,2,2.5) microorg<-factor(rep(c("E. coli","L. monocytogenes"),each=6)) tratam<-factor(rep(c("t1","t2"),6)) xyplot(logCFU~t|microorg+

Re: [R] columnwise nnzero for dgCMatrix

2011-06-26 Thread Dennis Murphy
Hi: What about colSums(mymat != 0) ? # Example: x <- matrix(sample(c(-1, 0, 1, 2), 100, replace = TRUE, prob = c(0.1, 0.8, 0.07, 0.03)), nrow = 25) which(x != 0) # 17 nonzero elements in this matrix [1] 9 17 27 32 36 41 44 45 49 50 62 67 68 72 76 78 82 colSums(x != 0) [1] 2 8 4

Re: [R] integration function

2011-06-26 Thread li li
Peter, Thank you very much! 2011/6/26 Peter Ehlers > On 2011-06-26 06:34, li li wrote: > >> Thank you all for the answering. >> Sorry I did not state the problem clearly. I want to take the >> integration with respect to mu, not x. >> For example, f1 should have been a function of x after integr

[R] tl moments diagram

2011-06-26 Thread osama hussien
The package lmomco gives the L-moments ratio diagram for some distributions. It is important to have the TL-moments ration diagrams also. Does anyone know how to get this diagrams. thank you -- Osama Abdelaziz Hussien Department of Statistics Faculty of Commerce Alexandria University Egypt _

Re: [R] Multivariate normal density in C for R

2011-06-26 Thread Dimitris Rizopoulos
On 6/26/2011 5:53 PM, zerfetzen wrote: IIRC, package mvtnorm will allow an X matrix, but requires mu to be a vector, so although it's close, it won't do it all...but all suggestions are well received. Dimitrius, you don't happen to have the multivariate t form of that function, do you? Well, i

Re: [R] Ordering a matrix based on cluster no

2011-06-26 Thread John Kane
Combine the two matrices into one data.frame and order them Example done using data.frames rather than matrices but just use use data.frame(x,y) to convert to a data.frame bmat <- data.frame(matrix(1:25,5)) smat <- data.frame(aa= LETTERS[1:25], bb = rep(c("a","b","c", "d", "e"),5)) df1 <-

Re: [R] Multivariate normal density in C for R

2011-06-26 Thread zerfetzen
IIRC, package mvtnorm will allow an X matrix, but requires mu to be a vector, so although it's close, it won't do it all...but all suggestions are well received. Dimitrius, you don't happen to have the multivariate t form of that function, do you? -- View this message in context: http://r.789695

Re: [R] String manipulation

2011-06-26 Thread Gabor Grothendieck
On Sun, Jun 26, 2011 at 11:00 AM, Gabor Grothendieck wrote: > On Sun, Jun 26, 2011 at 10:54 AM, Megh Dal wrote: >> Dear all, I have following kind of character vector: >> >> Vec <- c("344426", "dwjjsgcj", "123sgdc", "aagha123", "sdh343asgh", >> "123jhd51") >> >> >> Now I want to split each eleme

Re: [R] String manipulation

2011-06-26 Thread David Winsemius
On Jun 26, 2011, at 10:54 AM, Megh Dal wrote: Dear all, I have following kind of character vector: Vec <- c("344426", "dwjjsgcj", "123sgdc", "aagha123", "sdh343asgh", "123jhd51") Now I want to split each element of this vector according to numeric and string element. For example in the

Re: [R] how to extract data from a function printout - example provided

2011-06-26 Thread Sarah Goslee
summary(m.out) is a list with items with those names. Once you know the names, you can extract them in the same way as you'd extract any element from a list: by name, by position, etc. On Sun, Jun 26, 2011 at 10:48 AM, Ana Kolar wrote: > Thank you Sarah! > But names(summary(m.out)) gives only the

Re: [R] integration function

2011-06-26 Thread Peter Ehlers
On 2011-06-26 06:34, li li wrote: Thank you all for the answering. Sorry I did not state the problem clearly. I want to take the integration with respect to mu, not x. For example, f1 should have been a function of x after integrating mu out of f(x, mu) which is the following: f(x, mu)=dnorm(x, m

Re: [R] String manipulation

2011-06-26 Thread Gabor Grothendieck
On Sun, Jun 26, 2011 at 10:54 AM, Megh Dal wrote: > Dear all, I have following kind of character vector: > > Vec <- c("344426", "dwjjsgcj", "123sgdc", "aagha123", "sdh343asgh", > "123jhd51") > > > Now I want to split each element of this vector according to numeric and > string element. For exam

[R] String manipulation

2011-06-26 Thread Megh Dal
Dear all, I have following kind of character vector: Vec <- c("344426", "dwjjsgcj", "123sgdc", "aagha123", "sdh343asgh", "123jhd51") Now I want to split each element of this vector according to numeric and string element. For example in the 1st element of that vector, there is no string elemen

Re: [R] how to extract data from a function printout - example provided

2011-06-26 Thread Sarah Goslee
As a start, run matchit() for a test dataset and look at: names(m.out) and names(summary(m.out)) You can save those named components in the usual ways. Sarah On Sun, Jun 26, 2011 at 10:06 AM, Ana Kolar wrote: > Hi there, > > Does anyone know how to extract data from a function that prints out tw

[R] how to extract data from a function printout - example provided

2011-06-26 Thread Ana Kolar
Hi there, Does anyone know how to extract data from a function that prints out two or more summaries? In the function below (the whole code is provided) we get 5 different tables of data. I would like to split each of these tables in a separate file (while the function itself shouldn't be chang

Re: [R] Multivariate normal density in C for R

2011-06-26 Thread Berend Hasselman
zerfetzen wrote: > > Does anyone know of a package that uses C code to calculate a multivariate > normal density? > > My goal is to find a faster way to calculate MVN densities and avoid R > loops or apply functions, such as when X and mu are N x K matrices, as > opposed to vectors, and in this

Re: [R] Why is looping in R inefficient, but in C not?

2011-06-26 Thread David Winsemius
On Jun 26, 2011, at 2:56 AM, Alexander Engelhardt wrote: Hey, I just read another post about calling R from C. Someone on stackoverflow (DWin makes me suspect its David W.?) referenced this: http://www.math.univ-montp2.fr/~pudlo/R_files/call_R.pdf Which made me think: Why is a loop in R bad,

[R] Ordering a matrix based on cluster no

2011-06-26 Thread Aparna Sampath
Hi All I have a symmetric matrix of genes ( 100x100 matrix). I also have a matrix (100x2) of two columns where column 1 has the gene names and column 2 has the cluster it belongs to (they are sorted and grouped based on the cluster no). I would like to order the rows and columns of the 100x 100 m

Re: [R] integration function

2011-06-26 Thread li li
Thank you all for the answering. Sorry I did not state the problem clearly. I want to take the integration with respect to mu, not x. For example, f1 should have been a function of x after integrating mu out of f(x, mu) which is the following: f(x, mu)=dnorm(x, mean=mu, sd=1)*dnorm(mu, mean=2, sd=1

[R] RJDBC and multiple classpaths

2011-06-26 Thread Orvalho Augusto
Corect me if this is not the right place to post this. I have a mdbdriver.jar (to access an MSAccess file) under Linux. I bought the license from http://www.csv-jdbc.com/ guys. The driver work fine when tested with DBVisualizer or another JDBC thing. The problem is that driver needs 3 other more

Re: [R] Access R functions from web

2011-06-26 Thread Orvalho Augusto
Thanks everyone! Now it became difficult to decide. I will give feedback soon. Caveman On Sat, Jun 25, 2011 at 9:59 PM, Tobias Verbeke < tobias.verb...@openanalytics.eu> wrote: > Hi Caveman, > > > On 06/25/2011 11:18 AM, Orvalho Augusto wrote: > > I need a way to send R objects and call R fun

Re: [R] Need help on a R script part

2011-06-26 Thread Hugo Mildenberger
Duncan, it isn't really that difficult to diagnose. A google search for "ss11=sample(x1, n1, replace=TRUE) " turned up this documented R-script ttp://www2.latech.edu/~dcahoy/TwoSampleEqualVarTest.R as a likely source for his fragmented and mangled post; other variable names

Re: [R] Multivariate normal density in C for R

2011-06-26 Thread zerfetzen
Dimitris, Thanks for the great code. When the number of rows of X and mu are large, it is probably faster due to R's vectorization. Thanks again. -- View this message in context: http://r.789695.n4.nabble.com/Multivariate-normal-density-in-C-for-R-tp3624602p3625857.html Sent from the R help maili

[R] Accessing variables in a data frame

2011-06-26 Thread Serguei Kaniovski
Hello My data.frame (dat) contains many variables named var.names and others named var.names_var.id For example var.name <- c("gdp","inf","unp") var.id <- c("w","i") x <- paste(var.name, rep(var.id, each=length(var.name)), sep="_") How can I access variables in the dama.frame by names listed

Re: [R] how to simulate Likert-type data using R

2011-06-26 Thread Tyler Rinker
?sample Date: Sun, 26 Jun 2011 02:26:10 -0700 From: wjca...@hotmail.com To: r-help@r-project.org Subject: [R] how to simulate Likert-type data using R Dear R members Could someone tell me how to simulate Likert-type data using the rnorm function. Let's say, 200*15 random numbers in a var

[R] how to simulate Likert-type data using R

2011-06-26 Thread wjcao
Dear R members Could someone tell me how to simulate Likert-type data using the rnorm function. Let's say, 200*15 random numbers in a variable that goes from 1 to 4 in steps of 1 (i.e., 1, 2, 3, 4) belonging to a normal distribution? random.data <— matrix(rnorm(200 * 15), nrow = 200, ncol

[R] Overlapping areas under normal distributions

2011-06-26 Thread scaramouch
Hi everyone. My problem: I've 4 distributions: A, B, C and D: #A mA=16.6 sA=3.0 #B mB=18.9 sB=3.2 #C mC=20.3 sC=2.1 #D mD=24 sD=0.8 ###Graphiques ensembles plot(function(x) dnorm(x,mA,sA),0,40,col="orange",ylim=c(0,0.5)) plot(function(x) dnorm(x,mB,sB),0,40,add=T,col="green")

[R] columnwise nnzero for dgCMatrix

2011-06-26 Thread C6H5NO2
Hi R users, I want to know whether there is a fast method to compute the nonzeroes for each column of dgCMatrix. For summation or average I can use colSums or colMeans. To count the non-zeroes I write a function colCounts <- function(Mat) { M1 <- apply(Mat, MARGIN=2, FUN=nnzero) } But it se

Re: [R] Help with lmer

2011-06-26 Thread Sophie Higgins
Hello Hugo, Thank you for your reply. This is a snap shot of what my data looks like: Presencebsence Habitatype Substratetype Width Banktype BankIncline Bankheight Waterdepth 0 Lake Rocksgravel 600 Earth 0.45 less1 greater2 0 Lake Rocksg

Re: [R] Multivariate normal density in C for R

2011-06-26 Thread Dimitris Rizopoulos
I use the following function which does not uses loops and seems to be pretty fast: dmvnorm <- function (x, mu, Sigma, df, log = FALSE) { if (!is.matrix(x)) x <- rbind(x) p <- nrow(Sigma) ed <- eigen(Sigma, symmetric = TRUE) ev <- ed$values if (!all(ev >= -1e-06 * abs

Re: [R] Why is looping in R inefficient, but in C not?

2011-06-26 Thread Patrick Burns
Probably the easiest way to think about it is that most of the extra time is the overhead of calling a function. So counting the number of calls to R functions is going to tell you how much overhead there is. (Remember that functions call other functions.) On 26/06/2011 08:21, Jeff Newmiller wro

Re: [R] cluster() or frailty() in coxph

2011-06-26 Thread Joshua Wiley
Hi Ehsan, My understanding (hopefully someone will jump in if this is wrong) is that cluster() identifies a variable that is an indicator for correlated observations (rats in a litter, children in a classroom, etc.). The relative risk from treatment (rx) is for a random sample of rats. frailty()

Re: [R] Why is looping in R inefficient, but in C not?

2011-06-26 Thread Jeff Newmiller
For the same reason the Cray XMP was fast at numerical computations... a loop written in a low level language can be optimized to work faster than one written in a higher level language. The XMP optimized loops into hardware, but R just optimizes them in C code, exposed to the R programmer as ve

[R] memory usage upon web-query using try function

2011-06-26 Thread cir p
Dear Community, my program below runs quite slow and I'm not sure whether the http-requests are to blame for this. Also, when running it gradually increases the memory usage enormously. After the program finishes, the memory is not freed. Can someone point out a problem in the code? Sorry my bas