Re: [R] Correlation between 2 matrices but with subset of variables

2012-03-08 Thread Petr Savicky
On Thu, Mar 08, 2012 at 03:57:06PM -0800, A Ezhil wrote: > Dear All, > I have two matrices A (40 x 732) and B (40 x 1230) and would like to > calculate correlation between them. ?I can use: cor(A,B, method="pearson") to > calculate correlation between all possible pairs. But the issue is that the

Re: [R] Re : Re : Adding mean line to a lattice density plot

2012-03-08 Thread Petr PIKAL
Hi > HI again, > > thanks for the replies. Unfortunately, due to my deadlines, I had no > time to test Petr's suggestion. I will test it later. I had to figure > out an alternate solution, so I decided to use "normal" plotting functions: > > > with(subset(ISGFINC2, as.numeric(SGENDER)==1), p

[R] Re : Moving average with loess

2012-03-08 Thread Pascal Oettli
Hi Robert, You can try ?lowess Regards, Pascal - Mail original - De : "Faryabi, Robert (NIH/NCI) [F]" À : "r-help@r-project.org" Cc : Envoyé le : Vendredi 9 mars 2012 8h43 Objet : [R] Moving average with loess Hello All, I just have a very simple question. I recently switching fro

Re: [R] index values of one matrix to another of a different size

2012-03-08 Thread Ben quant
> Hello, > > Is this the fastest way to use indices from one matrix to reference rows > in another smaller matrix? I am dealing with very big data (lots of columns > and I have to do this lots of times). > > ##sample data ## > vals = matrix(LETTERS[1:9], nrow=3,ncol=3) > colnames(va

[R] (Fisher) Randomization Test for Matched Pairs: Permutation Data Setup Based on Signs

2012-03-08 Thread Ghandalf
Hi, I am currently attempting to write a small program for a randomization test (based on rank/combination) for matched pairs. If you will please allow me to introduce you to some background information regarding the test prior to my question at hand, or you may skip down to the bold portion for m

[R] From (common IDs different Names) To (common IDs common Names)

2012-03-08 Thread Sichong Chen
Dear Community I have a large dataframe x as follows with common ids but different names: > x <- data.frame(ID = c(1,1,2,2,2,3,3), + Name = c("B Branch A Firm ","A Firm","B Firm","B Firm","B Firm C Branch","C Firm","C Firm A Branch") + ) > x ID Name 1 1 B Branch A Firm 2 1

Re: [R] How to extract numerical values from time series forecast

2012-03-08 Thread ForzaBruta
thanks for the reply. the day after posting this question, i thought of the most obvious solution to it; "write.csv" -- View this message in context: http://r.789695.n4.nabble.com/How-to-extract-numerical-values-from-time-series-forecast-tp4432165p4458610.html Sent from the R help mailing list ar

Re: [R] Correlation between 2 matrices but with subset of variables

2012-03-08 Thread chuck.01
Example data would be helpful A Ezhil wrote > > Dear All, > I have two matrices A (40 x 732) and B (40 x 1230) and would like to > calculate correlation between them.  I can use: cor(A,B, method="pearson") > to calculate correlation between all possible pairs. But the issue is that > there is

[R] binning dates by decade for simulated data

2012-03-08 Thread Jeff Garcia
I have a simulated matrix of dates that I generated from a probability function. Each column represents a single iteration. I would like to bin each run _separately_ by decades and dump them into a new matrix where each column is the length of all decades a single run with the number dates bin

Re: [R] Boxplot Fill Pattern

2012-03-08 Thread Gabriel Yospin
Thanks for the help, Michael. ggplot2 is an interesting package. It would nice if there were better documentation in the help files, but the (fully functional) code (with fake data) I've settled on is below. I am particularly pleased with the theme_bw, which will use less ink than the default theme

[R] pdMat class in LME to mimic SAS proc mixed group option? Group-specific random slopes

2012-03-08 Thread Langbehn, Douglas
I would like to be able to use lme to fit random effect models In which some but not all of the random effects are constrained to be independent. It seems as thought the pdMat options in lme are a promising avenue. However, none of the existing pdMat classes seem to allow what I want. As a spe

Re: [R] read.xls - ampersand different in XLS and XLSX

2012-03-08 Thread AAsk
& is an XML entity & Excel 2007 onwards are XML aware. If your worksheet does not exceed 65536 rows by 256 columns, the easiest solution is to open the XLSX file and save it in XLS format. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailma

[R] binning dates by decade for simulated data

2012-03-08 Thread jtgarcia
I have a simulated matrix of dates that I generated from a probability function. Each column represents a single iteration. I would like to bin each run _separately_ by decades and dump them into a new matrix where each column is the length of all decades a single run with the number dates binned

[R] Moving average with loess

2012-03-08 Thread Faryabi, Robert (NIH/NCI) [F]
Hello All, I just have a very simple question. I recently switching from Matlab to R, so cannot figure out some of the easy tasks in the new environment. Is there any weighted local regression smoothing in R? Basically, I want to have weighted moving average. All the functions that I know of ne

[R] Extended Survival Plot Lines

2012-03-08 Thread mtkent189
I've obtained a survival plot from the following code: s = Surv(outcome.[,1], outcome.[,2]) survplot= (survfit(s ~ person.list[,1])) plot(survplot, mark.time = FALSE) person.list is just a list of 15 people. When I plot this, the lines on my plot all end at different time points. Is

Re: [R] (no subject)

2012-03-08 Thread j verzani
Mark Heckmann gmx.de> writes: > > When using a gtkDrawingArea as a Cairo device I very often > encounter the error: "figure margins too large" > Even for the below "getting started" example from > http://www.ggobi.org/rgtk2/ this is the case. This can be avoided with the following: lib

Re: [R] Calling a column from a matrix using a variable

2012-03-08 Thread Rui Barradas
Hello, Try x<-data.frame(A=1:5,B=6:10,C=11:15,D=16:20,E=21:26) titles<-c("A","B","C","E") y <- "C" x[ , y] Hope this helps, Rui Barradas -- View this message in context: http://r.789695.n4.nabble.com/Calling-a-column-from-a-matrix-using-a-variable-tp4457466p4457509.html Sent from the R help

[R] Calling a column from a matrix using a variable

2012-03-08 Thread rgm
Hi there, I'm having some difficulty using a variable to call a column from a matrix. I am trying to analyze several columns against each other using a for loop in the following way: x<-data.frame(A=1:5,B=6:10,C=11:15,D=16:20,E=21:26) titles<-c("A","B","C","E") for( i in 1:length(titles)){ y<-t

Re: [R] index instead of loop?

2012-03-08 Thread Rui Barradas
Hello, > Humm If I understand what you are saying, you are correct. I get > 144.138 for 2009-03-20 for column C. Maybe I posted the wrong code? If > so, > sorry. I think I have the fastest so far solution, and it checks with your corrected,last one. I've made just a change: to transform it

[R] poLCA

2012-03-08 Thread Lucy
Hi, I am running some latent class models with civariates using poLCA in R, and have a question the meaning of some error messages. My model has 8 y-variables (dichotomous) and 2 x-variables (also dichotomous), and I am trialling different numbers of classes. When I run a 2-class model, the mode

[R] rpanel / list error

2012-03-08 Thread jism7690
Hi All, I have created a simulation that works perfect and I have the results been returned in a list as I have multiple values. I then decided to include some user interaction by using the package rpanel, I now get the error: object of type 'builtin' is not subsettable when I attempted to have

Re: [R] making a second version of R

2012-03-08 Thread Hervé Pagès
Hi Erin, On 03/08/2012 08:11 PM, Erin Hodgess wrote: Hi R People: I currently have a version on R on a Debian squeeze Linux machine, which I obtained via "apt-get instal" Now I would like to have a second installation of R (for a small experiment) that I compile myself from the tar file.

[R] making a second version of R

2012-03-08 Thread Erin Hodgess
Hi R People: I currently have a version on R on a Debian squeeze Linux machine, which I obtained via "apt-get instal" Now I would like to have a second installation of R (for a small experiment) that I compile myself from the tar file. I'm going to delete it as soon as the experiment fails,

Re: [R] Correlation between 2 matrices but with subset of variables

2012-03-08 Thread A Ezhil
Thanks a lot, Michael.  --- On Fri, 3/9/12, R. Michael Weylandt wrote: From: R. Michael Weylandt Subject: Re: [R] Correlation between 2 matrices but with subset of variables To: "A Ezhil" Cc: r-help@r-project.org Date: Friday, March 9, 2012, 7:59 AM Well, it would be possible to set something

Re: [R] Boxplot Fill Pattern

2012-03-08 Thread R. Michael Weylandt
It looks very nice -- hopefully your reviewers agree. The built in documentation is a little sparse (though greatly enhanced in the newest 0.9.0 release) -- but Hadley's website http://had.co.nz/ggplot2/ is very good and there's a ggplot2 book available on Amazon (though it's a little out of date

Re: [R] Correlation between 2 matrices but with subset of variables

2012-03-08 Thread R. Michael Weylandt
Well, it would be possible to set something up to select out just the right pairs each time, but on my system the following a <- matrix(rnorm(40 * 732), 40) b <- matrix(rnorm(40 * 1230), 40) system.time(cor(a,b,method = "pearson")) takes about a tenth of a second so any more elective approach wi

Re: [R] Packages 'effects' loads 'name' which conflicts with 'lme4' [corrected subject: Package 'effects' loads 'nlme' which conflicts with 'lme4']

2012-03-08 Thread Michael Kubovy
Dear John, That's most helpful. Thank you. MK On Mar 8, 2012, at 9:03 PM, John Fox wrote: > Dear Michael and Spencer, > > I've modified the development version of the effects package on R-Forge so > that the nlme and lme4 packages are listed under "Suggests" rather than > "Depends". In this

Re: [R] Packages 'effects' loads 'name' which conflicts with 'lme4' [corrected subject: Package 'effects' loads 'nlme' which conflicts with 'lme4']

2012-03-08 Thread John Fox
Dear Michael and Spencer, I've modified the development version of the effects package on R-Forge so that the nlme and lme4 packages are listed under "Suggests" rather than "Depends". In this way, neither package is loaded along with effects. Best, John On Thu, 8 Mar 2012 20:45:37 -0500 Mic

Re: [R] Packages 'effects' loads 'name' which conflicts with 'lme4' [corrected subject: Package 'effects' loads 'nlme' which conflicts with 'lme4']

2012-03-08 Thread Michael Kubovy
Hi Spencer, In an Sweave script, which would take me too long to boil down to a reproducible example, lme4 was loaded before effects, and a calculation involving the effect() function failed. This was remedied by following John's advice and loading the two packages in the order he recommended a

Re: [R] Regarding randomForest regression

2012-03-08 Thread Stefan MA (MOH)
Sent from my HTC -Original Message- From: David Winsemius Sent: Friday, 9 March 2012 12:26 AM To: shameek ghosh Cc: r-help@r-project.org Subject: Re: [R] Regarding randomForest regression On Mar 8, 2012, at 5:10 AM, shameek ghosh wrote: > Sir, > This query is related to randomF

Re: [R] Reading in 9.6GB .DAT File - OK with 64-bit R?

2012-03-08 Thread Gabor Grothendieck
On Thu, Mar 8, 2012 at 1:19 PM, RHelpPlease wrote: > Hi there, > I wish to read a 9.6GB .DAT file into R (64-bit R on 64-bit Windows machine) > - to then delete a substantial number of rows & then convert to a .csv file. > Upon the first attempt the computer crashed (at some point last night). > >

Re: [R] Reading in 9.6GB .DAT File - OK with 64-bit R?

2012-03-08 Thread RHelpPlease
Hi Sarah, Thanks for the SQL info! I'll look into these straightaway, along with the notion of opening a text connection. Thanks again! -- View this message in context: http://r.789695.n4.nabble.com/Reading-in-9-6GB-DAT-File-OK-with-64-bit-R-tp4457220p4458083.html Sent from the R help mailin

Re: [R] Reading in 9.6GB .DAT File - OK with 64-bit R?

2012-03-08 Thread RHelpPlease
Hi Barry, "You could do a similar thing in R by opening a text connection to your file and reading one line at a time, writing the modified or selected lines to a new file." Great! I'm aware of this existing, but don't know the commands for R. I have a variable [560,1] to use to pare down the

[R] Correlation between 2 matrices but with subset of variables

2012-03-08 Thread A Ezhil
Dear All, I have two matrices A (40 x 732) and B (40 x 1230) and would like to calculate correlation between them.  I can use: cor(A,B, method="pearson") to calculate correlation between all possible pairs. But the issue is that there is one-many specific mappings between A and B and I just need

Re: [R] Reading in 9.6GB .DAT File - OK with 64-bit R?

2012-03-08 Thread Sarah Goslee
Hi, On Thu, Mar 8, 2012 at 6:45 PM, RHelpPlease wrote: > Hi Jeff & Steve, > Thanks for your responses.  After seven hours R/machine ran out of memory > (and thus ended).  Currently the machine has 4GB RAM.  I'm looking to > install more RAM tomorrow. You can't load a 9.6GB dataset into 4GB of RA

Re: [R] Reading in 9.6GB .DAT File - OK with 64-bit R?

2012-03-08 Thread RHelpPlease
Hi Jeff & Steve, Thanks for your responses. After seven hours R/machine ran out of memory (and thus ended). Currently the machine has 4GB RAM. I'm looking to install more RAM tomorrow. I will look into SQLLite3; thanks! I've read that SQL would be a great program for data of this size (read-in

Re: [R] Reading in 9.6GB .DAT File - OK with 64-bit R?

2012-03-08 Thread Barry Rowlingson
On Thu, Mar 8, 2012 at 6:19 PM, RHelpPlease wrote: > Hi there, > I wish to read a 9.6GB .DAT file into R (64-bit R on 64-bit Windows machine) > - to then delete a substantial number of rows & then convert to a .csv file. > Upon the first attempt the computer crashed (at some point last night). I

Re: [R] Reading in 9.6GB .DAT File - OK with 64-bit R?

2012-03-08 Thread Steve Lianoglou
Hi, On Thu, Mar 8, 2012 at 1:19 PM, RHelpPlease wrote: > Hi there, > I wish to read a 9.6GB .DAT file into R (64-bit R on 64-bit Windows machine) > - to then delete a substantial number of rows & then convert to a .csv file. > Upon the first attempt the computer crashed (at some point last night)

Re: [R] Reading in 9.6GB .DAT File - OK with 64-bit R?

2012-03-08 Thread Jeff Newmiller
My opinion is that you should be spending your effort on setting up a SQL engine and importing it there. If you have 32GB of RAM your current direction might work, but working with sampled data rather than population data seems pretty typical for statistical analysis. ---

Re: [R] legend

2012-03-08 Thread Chintanu
Thanks - Jason Connor, Rolf Turner and Pascal Oettli. Either of the following can remove the border surrounding the words. legend (locator(1), "Important ones", box.col=NA) legend (locator(1), " Important ones ", bty="n") regards, Chintanu [[alternative HTML version deleted]] _

Re: [R] "figure margins too large" in RGtk2 drawing area as cairo device - why?

2012-03-08 Thread Mark Heckmann
Peter, thanks for the answer! Indeed, it does work if I set par(mar=c(0,0,0,0)) but not when it is set to the default values mar=c(5.1, 4.1, 4.1, 2.1). The par settings returned in the example are the defaults, so no extraordinary big mar settings or char size (see below). Also, it does not matte

Re: [R] "figure margins too large" in RGtk2 drawing area as cairo device - why?

2012-03-08 Thread peter dalgaard
On Mar 8, 2012, at 20:27 , Mark Heckmann wrote: > When using a gtkDrawingArea as a Cairo device I very often encounter the > error: "figure margins too large" > Even for the below "getting started" example from http://www.ggobi.org/rgtk2/ > this is the case. > >> win = gtkWindow() >> da = gtk

Re: [R] Classification by range

2012-03-08 Thread David Winsemius
On Mar 8, 2012, at 3:14 PM, Ajay Askoolum wrote: Given studentNumbers<-10; subjEnglish<-sample(-1:100,studentNumbers,replace=TRUE); when subEnglish <=0, 'U' <=39, 'F' <=49 'D' <=59, 'C' <=69, 'B'

Re: [R] Classification by range

2012-03-08 Thread jim holtman
?findInterval > subjEnglish<-sample(-1:100,studentNumbers,replace=TRUE); > grade <- c(-Inf, 39, 49, 59, 69, 79, 100) # grade break points > let <- c("U", "F", "D", "C", "B", "A", "A+")[findInterval(subjEnglish, grade)] > cbind(subjEnglish, let) subjEnglish let [1,] "77""B" [2,] "9

[R] read.xls - ampersand different in XLS and XLSX

2012-03-08 Thread Zev Ross
Hi All, I'm using read.xls from GDATA and it seems to be treating ampersands differently depending on whether the source file is an XLS or the more current XLSX. Ampersands from an XLSX become &. As a test I have a csv: write.csv(data.frame(a=c("JERRY", "DICK & LINDA")), "ampersand.csv", ro

[R] Classification by range

2012-03-08 Thread Ajay Askoolum
Given studentNumbers<-10; subjEnglish<-sample(-1:100,studentNumbers,replace=TRUE); when subEnglish <=0, 'U'     <=39, 'F'     <=49 'D'     <=59, 'C'     <=69, 'B'     <=79,'A'

[R] Warnings when plotting after x11() in R 2.14.2

2012-03-08 Thread Mark Seeto
Dear R-help, I recently upgraded from R 2.13.1 to R 2.14.2 and now get warning messages when plotting after using x11(). Example: > plot(rnorm(10))### no warnings > x11(); plot(rnorm(10)) Warning messages: 1: In axis(side = side, at = at, labels = labels, ...) : Font family not found in Wi

Re: [R] Difference in Kaplan-Meier estimates plus CI

2012-03-08 Thread Thomas Lumley
On Fri, Mar 9, 2012 at 3:08 AM, Terry Therneau wrote: > A note on standard errors:  S(t) +- std is a terrible confidence > interval.  You will be much more accurate if you use log scale.  (Some > argue for logit or log-log, in truth they work well.)   If n is large > enough, however, you should b

[R] "figure margins too large" in RGtk2 drawing area as cairo device - why?

2012-03-08 Thread Mark Heckmann
When using a gtkDrawingArea as a Cairo device I very often encounter the error: "figure margins too large" Even for the below "getting started" example from http://www.ggobi.org/rgtk2/ this is the case. > win = gtkWindow() > da = gtkDrawingArea() > win$add(da) > asCairoDevice(da) [1] TRUE > plo

Re: [R] Boxplot Fill Pattern

2012-03-08 Thread R. Michael Weylandt
On Thu, Mar 8, 2012 at 1:08 PM, Gabriel Yospin wrote: > Hello R Help! Hello Gabe Yospin! (I feel like I should start playing some arena rock anthem now ;-) ) > > I would like to make a legible boxplot of tree growth rates for each of > seven tree species at each of seven different sites. It's a

Re: [R] sas retain statement in R or fitting differene equations in NLS

2012-03-08 Thread Berend Hasselman
On 08-03-2012, at 14:50, Journals wrote: > I wish to fit a dynamical model in R and I am running in a problem that > requires some of your wisdom to solve. For SAS users I am searching for > the equivalent of the */retain/ *statement. > > For people that want to read complicated explanations t

[R] Reading in 9.6GB .DAT File - OK with 64-bit R?

2012-03-08 Thread RHelpPlease
Hi there, I wish to read a 9.6GB .DAT file into R (64-bit R on 64-bit Windows machine) - to then delete a substantial number of rows & then convert to a .csv file. Upon the first attempt the computer crashed (at some point last night). I'm rerunning this now & am closely monitoring Processor/CPU/

[R] Boxplot Fill Pattern

2012-03-08 Thread Gabriel Yospin
Hello R Help! I would like to make a legible boxplot of tree growth rates for each of seven tree species at each of seven different sites. It's a lot of data to put on one figure, I know. I made a beautiful, interpretable figure using color, but my target journal can't deal with color figures. I c

[R] Lattice Levelplot data question

2012-03-08 Thread kcroyals
Hi I am very new to R. I am using lattice package to create levelplot. Original code has levelplot(cor.Cars93[ord, ord], xlab = NULL, ylab = NULL) where cor.Cars93 is 18x18 double matrix containing correlation between variables, and ord is just order of variables. However my data looks like Var1 Va

Re: [R] Help with ANOVA in R

2012-03-08 Thread lulumecindy
Hello everyone: I'm a new member of this group. Following the question(2) of Amit Patel-7, I know "oneway.test" has the option of "var.equal=F". Maybe it's can be the answer of this quest

Re: [R] Re : Re : Adding mean line to a lattice density plot

2012-03-08 Thread K. Elo
HI again, thanks for the replies. Unfortunately, due to my deadlines, I had no time to test Petr's suggestion. I will test it later. I had to figure out an alternate solution, so I decided to use "normal" plotting functions: > with(subset(ISGFINC2, as.numeric(SGENDER)==1), plot(density(PV1CIV

Re: [R] Packages 'effects' loads 'name' which conflicts with 'lme4' [corrected subject: Package 'effects' loads 'nlme' which conflicts with 'lme4']

2012-03-08 Thread John Fox
Dear Spencer, Perhaps I misunderstand what you suggest, but I don't see how importing objects helps, when there are objects of the same name in both nlme and lme4 that users of effects will use in different circumstances. That is effect.lmer() and effect.lme() should both work, though not in the s

Re: [R] Copy dataframe for another

2012-03-08 Thread Sarah Goslee
What exactly are you trying to do? We can't replicate your code because we don't have your data, we don't know what your objective is, and we don't know what went wrong. Also, Null and NULL are not the same thing. On Thu, Mar 8, 2012 at 11:26 AM, RMSOPS wrote: > > I'm trying to copy the results

Re: [R] Copy dataframe for another

2012-03-08 Thread R. Michael Weylandt
What goes wrong? Your code isn't reproducible and you didn't give an error message. I'd mention that "d <- Null" does not assign NULL to d which might lead to a dimension mismatch at some point. Also, something about your loop syntax seems funny: you are looping over rows but selecting columns of y

Re: [R] Calculating length of consecutive sequences within a vector

2012-03-08 Thread Sarah Goslee
?rle If your "vector" is as shown, you'll need to split it into its component elements first, possibly with strsplit(). If you use dput() or some other means of providing a reproducible example, someone might be inclined to offer you actual code. Sarah On Thu, Mar 8, 2012 at 9:35 AM, Jorge Moli

[R] Copy dataframe for another

2012-03-08 Thread RMSOPS
I'm trying to copy the results of a dataframe to another within a cycle for but I am not able to implement the rbind, because give th d<-Null df<-NULL for(r in 2: nrow(x)) { val_user<-x.name[[r]] pos<-x.pos[[r]] -4 age <-x.age[[r]] d<-data.frame(val_user,pos,) pr

Re: [R] problem with data

2012-03-08 Thread Sarah Goslee
Is v_star a vector? That is, was it already created? Otherwise you'll need: v_star <- x.sub$Time[1] as a number of people have already suggested. Sarah On Thu, Mar 8, 2012 at 9:39 AM, RMSOPS wrote: > > Hello > >  I try save the results in the the vector, > > v_star[1]<-x.sub$Time[1] > >   and g

Re: [R] Calculating length of consecutive sequences within a vector

2012-03-08 Thread R. Michael Weylandt
rle should get you started. Michael On Thu, Mar 8, 2012 at 9:35 AM, Jorge Molinos wrote: > Hi all, > > I have a nx1 logical array of zeros and ones and I want to calculate the > individual lengths of all 1-consecutive sequences contained in it. Is there > an easy quick way to do this in R? So,

[R] Copy dataframe for another

2012-03-08 Thread RMSOPS
I'm trying to copy the results of a dataframe to another within a cycle for but I am not able to implement the rbind, because give th d<-Null df<-NULL for(r in 2: nrow(x)) { val_user<-x.name[[r]] pos<-x.pos[[r]] -4 age <-x.age[[r]] d<-data.frame(val_user,pos,)

Re: [R] problem with data

2012-03-08 Thread RMSOPS
Hello I try save the results in the the vector, v_star[1]<-x.sub$Time[1] and give me the following error In v_end[1] <- x.sub$Time[1] : number of items to replace is not a multiple of replacement length, how put this [1] *"2006-10-31 19:03:01 EST"* inside the vetor Thanks -- Vi

[R] Calculating length of consecutive sequences within a vector

2012-03-08 Thread Jorge Molinos
Hi all, I have a nx1 logical array of zeros and ones and I want to calculate the individual lengths of all 1-consecutive sequences contained in it. Is there an easy quick way to do this in R? So, if I have a vector such as 1110011011110 I would like to get (1) 3, (2) 2, (3) 1, (4) 7 A

Re: [R] Find identical pairs

2012-03-08 Thread Downey, Patrick
Hi Alex, x <- sample.int(4,20,replace=TRUE) y <- sample.int(4,20,replace=TRUE) cbind(x,y)[x==y,] Thanks, Mitch -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Alaios Sent: Thursday, March 08, 2012 11:18 AM To: R help Subject: [R]

Re: [R] Regarding randomForest regression

2012-03-08 Thread David Winsemius
On Mar 8, 2012, at 5:10 AM, shameek ghosh wrote: Sir, This query is related to randomForest regression using R. I have a dataset called qsar.arff which I use as my training set and then I run the following function - rf=randomForest(x=train,y=trainy,xtest=train,ytest=trainy,n

Re: [R] Find identical pairs

2012-03-08 Thread R. Michael Weylandt
Perhaps which(x == y) or intersect(x,y) or x %in% y or many others. You really need to give an example of x and y and say what you mean by "identical pairs" to get any concrete suggestions. Michael On Thu, Mar 8, 2012 at 11:17 AM, Alaios wrote: > Dear all I am having two numerical vector the x

[R] Find identical pairs

2012-03-08 Thread Alaios
Dear all I am having two numerical vector the x and y. I would like to find the identical x,y pairs. How I can do that in R? I would like to thank you in advance B.R Alex [[alternative HTML version deleted]] __ R-help@r-project.org mailing

Re: [R] Packages 'effects' loads 'name' which conflicts with 'lme4' [corrected subject: Package 'effects' loads 'nlme' which conflicts with 'lme4']

2012-03-08 Thread Spencer Graves
Dear John, et al.: What happens with import(foo) and importFrom(foo, f, g) with foo in suggests? Does foo appear in the search path? If no, then it may be wise to specify all uses in package "mine" of objects from package "other" using import and importFrom with "other" in suggests.

Re: [R] Packages 'effects' loads 'name' which conflicts with 'lme4' [corrected subject: Package 'effects' loads 'nlme' which conflicts with 'lme4']

2012-03-08 Thread John Fox
Dear Spencer, > -Original Message- > From: Spencer Graves [mailto:spencer.gra...@prodsyse.com] > Sent: March-08-12 10:29 AM > To: Michael Kubovy > Cc: John Fox; r-help > Subject: Re: [R] Packages 'effects' loads 'name' which conflicts with > 'lme4' [corrected subject: Package 'effects' loa

Re: [R] index instead of loop?

2012-03-08 Thread Ben quant
Humm If I understand what you are saying, you are correct. I get 144.138 for 2009-03-20 for column C. Maybe I posted the wrong code? If so, sorry. Let me know if you disagree. I still plan to come back to this and optimize it more, so if you see anything that would make it faster that would b

Re: [R] Problem with a Matrix

2012-03-08 Thread John Kane
I think this is what you want. library(reshape2) dcast( xx, Site.No ~ Plant.Name) John Kane Kingston ON Canada > -Original Message- > From: medo_bot...@hotmail.com > Sent: Thu, 8 Mar 2012 01:20:42 -0800 (PST) > To: r-help@r-project.org > Subject: [R] Problem with a Matrix > > Dear All,

Re: [R] Packages 'effects' loads 'name' which conflicts with 'lme4' [corrected subject: Package 'effects' loads 'nlme' which conflicts with 'lme4']

2012-03-08 Thread Spencer Graves
Dear John, et al.: What happens if lme4 is loaded before the effect package? Is this an issue of a user wanting to use two different packages with potentially conflicting names? What are the standard recommendations for handling issues like this? Just to test my comprehension,

[R] Panel models: Fixed effects & random coefficients in plm

2012-03-08 Thread Downey, Patrick
Hello, I am using {plm} to estimate panel models. I want to estimate a model that includes fixed effects for time and individual, but has a random individual effect for the coefficient on the independent variable. That is, I would like to estimate the model: Y_it = a_i + a_t + B_i * X_it + e_it W

Re: [R] how to modify the tickment of x-axis

2012-03-08 Thread John Kane
The R-help list usually strips attachements and did so with yours so we have no data. You can include sample data by using dput and pasting the result into your email. See ?dput for more information. John Kane Kingston ON Canada > -Original Message- > From: totang...@gmail.com > Sent

Re: [R] How to sort frequency distribution table?

2012-03-08 Thread John Kane
Here is a quick start. You will have to either greatly reduce the length of the names or play around with various plot or barplot options to get the x labels. Have a look at ?plot.default and ?barplot for more information John Kane Kingston ON Canada =

Re: [R] Save/Load function()-result to file in a loop

2012-03-08 Thread Johannes Radinger
Original-Nachricht > Datum: Thu, 08 Mar 2012 09:51:01 -0500 > Von: Duncan Murdoch > An: "R. Michael Weylandt" > CC: Johannes Radinger , R-help@r-project.org > Betreff: Re: [R] Save/Load function()-result to file in a loop > On 08/03/2012 8:42 AM, R. Michael Weylandt wrote: > >

Re: [R] Re : Re : Adding mean line to a lattice density plot

2012-03-08 Thread Petr PIKAL
Hi You can use this function to add arbitrary line to already plotted lattice graph. addLine<- function(a=NULL, b=NULL, v = NULL, h = NULL, ..., once=F) { tcL <- trellis.currentLayout() k<-0 for(i in 1:nrow(tcL)) for(j in 1:ncol(tcL)) if (tcL[i,j] > 0) { k<-k+1 trellis.focus("pane

Re: [R] Novice Alert!: odfWeave help!

2012-03-08 Thread John Kane
odfWeave is an R package. First off, be sure it is installed. Use install.packages("odfWeave") to install it and then load it with the command library(odfWeave) General Intro http://cran.r-project.org/web/packages/odfWeave/vignettes/odfWeave.pdf Specific newbie tips. http://datamining.t

Re: [R] Save/Load function()-result to file in a loop

2012-03-08 Thread Duncan Murdoch
On 08/03/2012 8:42 AM, R. Michael Weylandt wrote: Load doesn't return the object you saved, but rather a character vector with the name of that object, here "x". So you would do something like load("/path/to/file_A") x # Here's your data or more robustly get(load("/path/to/file_A")) See ?load

[R] evaluation of categorical and opinion data

2012-03-08 Thread Petr PIKAL
Dear all. I have some data and I seek the way to start their evaluation. The values are from survey of different persons and their opinion about various methods (metoda) and instrument (uzel). I am not sure where to start. I would like to end with combination of method (metoda) and instrument

Re: [R] changing the drawing context using Cairo and RGtk2

2012-03-08 Thread Michael Lawrence
On Wed, Mar 7, 2012 at 1:47 PM, Mark Heckmann wrote: > Michael, thanks for your answer! > > The attribute solution has its problems though. > First, how it will work: > > foo <- function(){ > w <- gtkWindow() > da <- gtkDrawingArea() > w$add(da) > asCairoDevice(da) > print(dev.cur()) >

[R] Simple solution

2012-03-08 Thread Oritteropus
Hi everybody, Thank you all for your suggestions, you have been very helpful. However at the end I solved in this way: mysample <- MaxDH[sample(1:nrow(MaxDH), 150, replace=FALSE),] A<-mysample[1:120,] B<-mysample[121:150,] So simple at the end... Best, Luca -- View this message in context: h

Re: [R] gsub: replacing double backslashes with single backslash

2012-03-08 Thread Ista Zahn
Thanks all, I realized the error of my ways last night. Apparently my brain was on vacation yesterday. Thanks to all for going through this yet again! Best, Ista On Thu, Mar 8, 2012 at 1:08 AM, Daniel Nordlund wrote: >> -Original Message- >> From: r-help-boun...@r-project.org [mailto:r-h

Re: [R] Difference in Kaplan-Meier estimates plus CI

2012-03-08 Thread Terry Therneau
--begin included message -- I thought this would be trivial, but I can't find a package or function that does this. I'm hoping someone can guide me to one. Imagine a simple case with two survival curves (e.g. treatment & control). I just want to calculate the difference in KM estimates at a spec

[R] Re : Re : Adding mean line to a lattice density plot

2012-03-08 Thread Pascal Oettli
Hi Kimmo, Unfortunately, I can't visualize the attachment. Could you provide an example I can reproduce? Regards, Pascal - Mail original - De : K. Elo À : r-help@r-project.org Cc : Envoyé le : Jeudi 8 mars 2012 22h38 Objet : Re: [R] Re : Adding mean line to a lattice density plot

Re: [R] problem with data

2012-03-08 Thread Prof Brian Ripley
On Thu, 8 Mar 2012, RMSOPS wrote: Hello In the variable x.sub$Time i have the many dates in format 2006-10-31 20:10:35 EST, for example when print (x.sub$Time) give this [1] "2006-10-31 20:10:35 EST" "2006-10-31 20:11:08 EST" "2006-10-31 20:11:21 EST" "2006-10-31 20:12:16 EST" [5] "2006-10-

Re: [R] Sampling problems

2012-03-08 Thread R. Michael Weylandt
Please use dput() to give a reproducible example: I can make this work on a data frame quite easily -- x <- data.frame(1:10, letters[1:10], rnorm(10)) str(x) print(x) x[sample(nrow(x), 5), ] So it's not a problem with something being a data frame or having factors. Michael On Thu, Mar 8, 2012 a

Re: [R] Problems with generalized linear model (glm) coefficients.

2012-03-08 Thread John Kane
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. We have nothing at all to go on. John Kane Kingston ON Canada > -Original Message- > From: lpchaparro...@gmail.com > Sent: Wed, 7 Mar 2012 10:3

Re: [R] how to modify the tickment of x-axis

2012-03-08 Thread R. Michael Weylandt
One way is to do it manually plot(..., xaxt = "n") axis(1, at = seq_along(wnd), labels = paste(seq_along(wnd), "h") The other is to give plot x and y vectors. Michael On Wed, Mar 7, 2012 at 10:25 PM, Jie Tang wrote: > hi >  I plot a series of observation data every minutes in a day as the > at

Re: [R] hierarchical clustering of large dataset

2012-03-08 Thread Sarah Goslee
See inline: On Thu, Mar 8, 2012 at 7:41 AM, Massimo Di Stefano wrote: > > Hello All, > > i've a set of observations that is in the form : > > a,    b,    c,    d,    e,    f > 67.12,    4.28,    1.7825,    30,    3,    16001 > 67.12,    4.28,    1.7825,    30,    3,    16001 > 66.57,    4.28,    

Re: [R] problem with data

2012-03-08 Thread R. Michael Weylandt
dput(x.sub) so we can see what you really have. Michael On Thu, Mar 8, 2012 at 4:35 AM, RMSOPS wrote: > Hello > >   In the variable x.sub$Time i have the many dates in format  2006-10-31 > 20:10:35 EST, for example when > print (x.sub$Time) give this > > [1] "2006-10-31 20:10:35 EST" "2006-10-3

Re: [R] Re : Adding mean line to a lattice density plot

2012-03-08 Thread K. Elo
Hi, thank you, Pascal, for your quick reply. Unfortunately your suggestion is not working. Please have a look on the attachment, I have added manually the mean lines I am trying to plot. The problem with 'abilne' seems to be that the argument 'v' is relative to the graph area, not the x-axis

Re: [R] parsing text files

2012-03-08 Thread ginger
Ooops, I forgot to specify that for each raw, containing records of the clinical reports , the values of the 22 parameter measurement have to be reported. For example, first raw, first 5 columns: ID DATE GLICEMIA AZOTEMIA CREATININEMIASODIEMIA ...

Re: [R] problem with data

2012-03-08 Thread Sarah Goslee
You don't provide either dput() or str() results, so nobody here knows exactly what your data format is. But as a first guess, you should probably be using sart<-x.sub$Time[1] instead. Sarah On Thu, Mar 8, 2012 at 4:35 AM, RMSOPS wrote: > Hello > >   In the variable x.sub$Time i have the many da

[R] sas retain statement in R or fitting differene equations in NLS

2012-03-08 Thread Journals
I wish to fit a dynamical model in R and I am running in a problem that requires some of your wisdom to solve. For SAS users I am searching for the equivalent of the */retain/ *statement. For people that want to read complicated explanations to help me: I have a system of two equations written

[R] xyplot without external box

2012-03-08 Thread Mauricio Zambrano-Bigiarini
Dear list members, Within a loop, I need to create an xyplot with only a legend, not even with the default external box drawn by lattice. I already managed to remove the axis labels and tick marks, but I couldn't find in the documentation of xyplot how to remove the external box. I would really

Re: [R] Correlation analysis for an exon array

2012-03-08 Thread R. Michael Weylandt
This question seems more suited to the Bioconductor mailing list: you'll get specialized (and very good) help if you post there. Michael On Thu, Mar 8, 2012 at 6:22 AM, Ekta Jain wrote: > Dear All, > I have an exon array and did not find any differential gene expression > between two samples. I

  1   2   >