Re: [R] class export in package creation / setClass / namespace?

2009-07-20 Thread Martin Maechler
> "MartinMo" == Martin Morgan > on Mon, 20 Jul 2009 18:57:33 -0700 writes: MartinMo> L L writes: >> Ok, I could solve also the latter problem by defining show.myclass function in >> the zzz.R file and adding the line 'S3method(show,myclass)' into NAMESPACE >> file.

Re: [R] heatmap plot

2009-07-20 Thread Michael Knudsen
2009/7/21 Markus Mühlbacher : > So just that I understand right. x and y are the scalings of the x and y axis > and the matrix represents the color of the points at each gridpoint? Precisely! Try ?image for more details. -- Michael Knudsen micknud...@gmail.com http://lifeofknudsen.blogspot.com

[R] legend title in qplot

2009-07-20 Thread rajesh j
Hi, I've used the following command in qplot qplot(a$V1,geom="histogram",binwidth=0.15,fill = factor(a$V2),ylab="Frequency",xlab="Rate"); but the title in the legend shows up as factor(a$V2)...how can i change this? -- Rajesh.J [[alternative HTML version deleted]] _

Re: [R] Another SEM question

2009-07-20 Thread Stein, Luba (AIM SE)
Hi, [,1] [,2] [,3] [1,] 4.820719e-03 -5.558801e-05 -5.718939e-05 [2,] -5.558801e-05 4.763194e-06 -7.661872e-06 [3,] -5.718939e-05 -7.661872e-06 1.662150e-03 This is mod.cov. It is the covariance matrix of (R, I, M). R, I and M are vectors of length 109 which

[R] [R-pkgs] new package 'dlnm' to run distributed lag non-linear models

2009-07-20 Thread Antonio.Gasparrini
Dear R Community, I am pleased to announce the release of a new package called 'dlnm', now available on CRAN (version 0.2.1). The package dlnm provides some facilities to run distributed lag models (DLM's) and their non-linear extension (DLNM's), a modelling framework to describe simultaneou

Re: [R] Another SEM question

2009-07-20 Thread Jarrett Byrnes
You don't appear to be defining Z here. Might that be the problem? Or, I, M, and R may not be defined either. It is unclear. What does mod.cov look like? On Jul 20, 2009, at 11:11 PM, Stein, Luba (AIM SE) wrote: Thank you for your advice. So I am sending the whole code data.dir <- file.

Re: [R] Another SEM question

2009-07-20 Thread Stein, Luba (AIM SE)
Thank you for your advice. So I am sending the whole code data.dir <- file.path(home.dir, "Data") file <- file.path(data.dir, "data4.csv") SEM <- read.csv(file) print(SEM) library(sem) SEM1 <- as.matrix(cbind(SEM$R1, SEM$I1, SEM$M1)) print(SEM1) mod.cov <- cov(SEM1) print(mod.cov) I <- SEM$

Re: [R] Simulate residuals with different properties for a linear model (regression)

2009-07-20 Thread Friedericksen Hope
Thank you both for your responses and the hints for help! Greetings, Friedericksen Friedericksen Hope wrote: Hey guys, for educational purposes I wonder if it is possible to simulate different data sets (or specifically residuals) for a linear regression. I would like to show my students resid

[R] Show representation of a data structure

2009-07-20 Thread bwgoudey
I'm currently working with some large complex data structures eg list of lists of data_frames containing lots more variables and lists etc. Sometimes, I'd like to be able to bring up a simple representation of the structure I'm working with, minus all of the values it contains (so simply printin

Re: [R] Re gression for loop test HELP! URGENT!

2009-07-20 Thread Daniel Malter
Hi, first, your initial statement of what you wanted to do was obviously ambiguous enough to confuse the responders. Therefore, clarity helps greatly in getting an accurate response. If I understand correctly, you have run ONE model on whatever data (also often called testing sample). Now you want

[R] geom_histogram help

2009-07-20 Thread rajesh j
Hi, I have a histogram.But I need seperate colours for fixed range of values.for eg. between 2-3 on the x axis a colour.3-4 another colour etc. and the legend has to say what each colour is.How can this be done in geom_histogram? -- Rajesh.J [[alternative HTML version deleted]] _

[R] how to change the "quantile" method in bwplot

2009-07-20 Thread Jun Shen
Hi, everyone, Since quantile calculation has nine different methods in R, I wonder how I specify a method when calling the bwplot() in lattice. I couldn't find any information in the documentation. Thanks. -- Jun Shen PhD PK/PD Scientist BioPharma Services Millipore Corporation 15 Research Park

[R] clim.pact question (annual cycle removal)

2009-07-20 Thread kapo coulibaly
I'm using the clim.pact package, I'm particularly interested in the EOF computation. I've noticed that whether I used the option to remove the annual cycle or not I get the same results. Am I missing something or the option hasn't been implemented yet? Thank you. [[alternative HTML versio

Re: [R] Re gression for loop test HELP! URGENT!

2009-07-20 Thread Steve Lianoglou
Hi, I think the problem is that I've been getting replies about how to make new regressions, when in fact, I need to use the one I've produced already to fit new data, 5 rows at a time, to see if it is also a good representation of further data. From the replies, I'm getting the impression

Re: [R] Re gression for loop test HELP! URGENT!

2009-07-20 Thread Rbeginner
I think the problem is that I've been getting replies about how to make new regressions, when in fact, I need to use the one I've produced already to fit new data, 5 rows at a time, to see if it is also a good representation of further data. From the replies, I'm getting the impression that the on

Re: [R] Simulate residuals with different properties for a linear model (regression)

2009-07-20 Thread hadley wickham
> for educational purposes I wonder if it is possible to simulate > different data sets (or specifically residuals) for a linear regression. > I would like to show my students residuals with different means, > variances and distributions (normal, but also not normal) in the plots > created with the

Re: [R] Re gression for loop test HELP! URGENT!

2009-07-20 Thread Rbeginner
Thanks Dr. Zuur for your reply. I've followed your suggestion, but it seems that this would only produce more regressions instead of use the one I produced originally to see if the original regression would fit new data? Is error analysis the only way i can make this happen? And how should I writ

Re: [R] class export in package creation / setClass / namespace?

2009-07-20 Thread Martin Morgan
L L writes: > Ok, I could solve also the latter problem by defining show.myclass function in > the zzz.R file and adding the line 'S3method(show,myclass)' into NAMESPACE > file. Now the package passes all checks. I would have, in NAMESPACE, importFrom(methods, show) exportMethods(show) and

Re: [R] Re al Time PCR data analysis help

2009-07-20 Thread gauravbhatti
I have looked at the package .it won't work for me since it requies us to read files with the format : The text file must have the following structure: 1st column = names denoting genes or primer pairs 2nd column = plate index of each gene or primer pair remaining colu

[R] Fama-Macbeth regression in R

2009-07-20 Thread Seung-hwan Chung
Dear all. currently, i have been studied cross-sectional regression. how to conduct cross-sectional regression by using R. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help P

[R] Correction.

2009-07-20 Thread Rolf Turner
It has been pointed out to me that I erred in an earlier post. ``Go stick your head in a pig.'' is not the motto of the (entire) Sirius Cybernetics Corporation. It is the motto if the Sirius Cybernetics Corporation ***Complaints Division***. My apologies for the misinformation. cheers

Re: [R] data frame from list of lists with unequal lengths

2009-07-20 Thread Henrique Dallazuanna
Try this: r <- strsplit(as.character(x$v1), "/") cbind(unlist(r), rep(x$v2, sapply(r, length))) On Mon, Jul 20, 2009 at 5:46 PM, Ben Mazzotta wrote: > Hello, > > I have a dataset with multiple entries in one field separated by "/" > characters. (The true dataset has long names, 20-odd variables

Re: [R] R package creation: 'show' extension not imported correctly

2009-07-20 Thread Duncan Murdoch
On 20/07/2009 7:53 PM, L L wrote: Dear List, I have a problem related to R package creation. I extended the 'show' method to cover a new class with the following lines in the zzz.R file in the R directory while creating an R package. setClass("rpa", contains="list") show.rpa <- function (...)

[R] R package creation: 'show' extension not imported correctly

2009-07-20 Thread L L
Dear List, I have a problem related to R package creation. I extended the 'show' method to cover a new class with the following lines in the zzz.R file in the R directory while creating an R package. >setClass("rpa", contains="list") >show.rpa <- function (...) {cat("rpa object \n")} The corres

[R] Accessing list object from within a function as a list element

2009-07-20 Thread nabble . 30 . miller_2555
Hi - I have a list (call it 'mylist') with the following elements: (i) a function (call it 'myfunc' and expressed as 'mylist$myfunc') and (ii) a variable (call it 'myvar' and expressed as 'mylist$myvar'). Since I use mylist as a pseudo-class (I assign mylist to multiple different R objects), I wou

Re: [R] class export in package creation / setClass / namespace?

2009-07-20 Thread L L
Ok, I could solve also the latter problem by defining show.myclass function in the zzz.R file and adding the line 'S3method(show,myclass)' into NAMESPACE file. Now the package passes all checks. The information on how to exactly extend existing methods and include new methods/classes into a packag

Re: [R] S_alloc or Calloc for return value

2009-07-20 Thread Dirk Eddelbuettel
On 20 July 2009 at 16:06, Dan Kelley wrote: | I am trying to write a C function to create a vector of integers that can be | used by the R calling function. I do not know the size of the vector in the | R calling function. (Well, actually, I have an upper limit on the size, but | that is so larg

Re: [R] Simulate residuals with different properties for a linear model (regression)

2009-07-20 Thread Juliet Hannah
Here are a couple of examples. # residuals not normal n <- 100; x = seq(n) y = 10 + 10 *x + 20 * rchisq(n,df=2) non_normal_lm = lm(y~x) #non-constant variance n <- 100; x = seq(n) y = 100 + 3 * x + rnorm(n,0,3) * x; het_var_lm = lm(y~x) #For each of these try: plot(non_normal_lm) plot(het_var_lm

Re: [R] S_alloc or Calloc for return value

2009-07-20 Thread David Winsemius
On Jul 20, 2009, at 7:06 PM, Dan Kelley wrote: I am trying to write a C function to create a vector of integers that can be used by the R calling function. I do not know the size of the vector in the R calling function. (Well, actually, I have an upper limit on the size, but that is so

[R] S_alloc or Calloc for return value

2009-07-20 Thread Dan Kelley
I am trying to write a C function to create a vector of integers that can be used by the R calling function. I do not know the size of the vector in the R calling function. (Well, actually, I have an upper limit on the size, but that is so large that R cannot allocate it. What I'm doing in the

Re: [R] Re al Time PCR data analysis help

2009-07-20 Thread Steve Lianoglou
On Jul 20, 2009, at 6:43 PM, Andrej Kastrin wrote: Check out qpcR package. Andrej gauravbhatti wrote: Hi I need help since I have never worked on RT PCR data before . I have 8 data files each corresponding to a single pcr run. Each file also represent 10 samples(5 cancer and 5 healthy)

Re: [R] Re al Time PCR data analysis help

2009-07-20 Thread Andrej Kastrin
Check out qpcR package. Andrej gauravbhatti wrote: Hi I need help since I have never worked on RT PCR data before . I have 8 data files each corresponding to a single pcr run. Each file also represent 10 samples(5 cancer and 5 healthy) belonging to a unique gene. I have 7 unique genes and 1 r

Re: [R] Re gression using age and Duration of disease as a continous factors

2009-07-20 Thread Steve Lianoglou
On Jul 20, 2009, at 5:30 PM, 1Rnwb wrote: I have read that multiple times without understanding anything. If that's the case, then perhaps you should follow Greg's first piece of advice: Greg Snow-2 wrote: If you need an explanation of what regression means, then you need to take a c

Re: [R] data frame from list of lists with unequal lengths

2009-07-20 Thread jim holtman
try this: > x v1 v2 1 A L 2 A/B M 3 C N 4 D/E/F O 5 A P 6 C L > as.data.frame(do.call(rbind, apply(x, 1, function(.row){ + cbind(strsplit(.row[1], '/')[[1]], .row[2]) + })),row.names='') V1 V2 1 A L 2 A M 3 B M 4 C N 5 D O 6 E O 7 F O 8 A P 9 C

Re: [R] Re gression using age and Duration of disease as a continous factors

2009-07-20 Thread 1Rnwb
I thought this forum is for help. now i know what the statistician in my dept does all day long Rolf Turner-3 wrote: > > > On 21/07/2009, at 5:30 AM, 1Rnwb wrote: > >> >> Please explain me as what it means and how this analysis can be >> done using R >> and which library(ies) are needed. >>

Re: [R] Re gression using age and Duration of disease as a continous factors

2009-07-20 Thread 1Rnwb
I have read that multiple times without understanding anything. Greg Snow-2 wrote: > > If you need an explanation of what regression means, then you need to take > a course or 2 at your local university, or at least hire a statistical > consultant. > > If you understand regression and just nee

[R] moving columns on a stripchart closer together

2009-07-20 Thread Leslie J Seltzer
Greetings I have a very simple question that I have not been able to solve by reading the manual. When I produce a stripchart with two straight columns of dots representing individual observations, one representing one group of subjects and the other representing another, the columns wind up

Re: [R] I need to obtain all the rows in m1 in which m2 the elements of m2 are present

2009-07-20 Thread Henrique Dallazuanna
Try this also: m1[as.logical(rowSums(matrix(m1 %in% m2, ncol = ncol(m1,] On Mon, Jul 20, 2009 at 5:09 PM, Alberto Lora M wrote: > Hi could you yelp me please with this > > Suppose that we have the following matrix > > m1<-matrix(c("a","7","a","i","o","u","i","1","2","3","4","5","6","7"), > n

Re: [R] I need to obtain all the rows in m1 in which m2 the elements of m2 are present

2009-07-20 Thread Jorge Ivan Velez
Hi Alberto, One way would be index <- apply(m1, 1, function(x) any(x %in% m2)) m1[ index, ] See ?apply, ?any and ?"%in%" for more details. HTH, Jorge On Mon, Jul 20, 2009 at 4:09 PM, Alberto Lora M wrote: > Hi could you yelp me please with this > > Suppose that we have the following matrix >

[R] I need to obtain all the rows in m1 in which m2 the elements of m2 are present

2009-07-20 Thread Alberto Lora M
Hi could you yelp me please with this Suppose that we have the following matrix m1<-matrix(c("a","7","a","i","o","u","i","1","2","3","4","5","6","7"), ncol=2) m1 [,1] [,2] [1,] "a" "1" [2,] "7" "2" [3,] "a" "3" [4,] "i" "4" [5,] "o" "5" [6,] "u" "6" [7,] "i" "7" m2<-c("a","7") I need

[R] Re al Time PCR data analysis help

2009-07-20 Thread gauravbhatti
Hi I need help since I have never worked on RT PCR data before . I have 8 data files each corresponding to a single pcr run. Each file also represent 10 samples(5 cancer and 5 healthy) belonging to a unique gene. I have 7 unique genes and 1 reference (total 8 files). Can any body help me with pr

Re: [R] RODBC results from stored procedure

2009-07-20 Thread Dieter Menne
tradenet wrote: > > Thanks Dieter. > > The date argument isn't a problem. When I invoke the stored proc > execution with the date arguments the stored proc runs fine, but RODBC > doesn't wait for the stored proc to finish and return results. > > Don't understand that one. How do you know t

Re: [R] mahalanobis distance

2009-07-20 Thread Ekin Akoglu
Thank you..this is what i needed... Rolf Turner wrote: On 21/07/2009, at 7:57 AM, Michael Knudsen wrote: On Mon, Jul 20, 2009 at 9:37 PM, ekinakoglu wrote: Could you please help me with a pseudo matrix of 4x4 that is gonna work with mahalanobis? Please speak English. ``gonna'' is not

[R] data frame from list of lists with unequal lengths

2009-07-20 Thread Ben Mazzotta
Hello, I have a dataset with multiple entries in one field separated by "/" characters. (The true dataset has long names, 20-odd variables, and hundreds of observations.) v1 v2 1 A L 2 A/B M 3 C N 4 D/E/F O 5 A P 6 C L What I would like is to have a dataset that lo

Re: [R] mahalanobis distance

2009-07-20 Thread Rolf Turner
On 21/07/2009, at 7:57 AM, Michael Knudsen wrote: On Mon, Jul 20, 2009 at 9:37 PM, ekinakoglu wrote: Could you please help me with a pseudo matrix of 4x4 that is gonna work with mahalanobis? Please speak English. ``gonna'' is not appropriate for written communication. H

Re: [R] EM Clustering

2009-07-20 Thread Ravi Varadhan
Look at the "mclust" package. --- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Health Division of Geriatric Medicine and Gerontology Johns Hopkins University Ph: (410) 502-2619 Fax: (410)

Re: [R] S4 method dispatch with inheritance

2009-07-20 Thread Martin Maechler
> "MH" == Michael Hahsler > on Mon, 20 Jul 2009 08:57:28 -0500 writes: MH> Hi, I'm trying to create a new S4 class (myMatrix) which MH> for now just extends dgCMatrix (from package MH> Matrix). Then I want to use "[" which is defined in MH> Matrix. MH> Out of the

Re: [R] EM Clustering

2009-07-20 Thread Steve Lianoglou
Hi, On Jul 20, 2009, at 4:21 PM, Douglas Sousa wrote: Hi all, could someone send me examples of the EM Clustering algorithm and/or some pdf describing it? Wikipedia: http://en.wikipedia.org/wiki/Expectation-maximization_algorithm You'll find useful links in the references and external link

Re: [R] Re gression using age and Duration of disease as a continous factors

2009-07-20 Thread Rolf Turner
On 21/07/2009, at 5:30 AM, 1Rnwb wrote: Please explain me as what it means and how this analysis can be done using R and which library(ies) are needed. Thanks Go stick your head in a pig! (***) cheers, Rolf Turner (***) Motto of the Sirius Cybernetics Corporati

[R] EM Clustering

2009-07-20 Thread Douglas Sousa
Hi all, could someone send me examples of the EM Clustering algorithm and/or some pdf describing it? Thanks, Douglas Sousa. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www

Re: [R] RODBC results from stored procedure

2009-07-20 Thread tradenet
Thanks Dieter. The date argument isn't a problem. When I invoke the stored proc execution with the date arguments the stored proc runs fine, but RODBC doesn't wait for the stored proc to finish and return results. Regards, Andrew Dieter Menne wrote: > > > > tradenet wrote: >> >> Short of

Re: [R] mahalanobis distance

2009-07-20 Thread Michael Knudsen
On Mon, Jul 20, 2009 at 9:37 PM, ekinakoglu wrote: > Could you please help me with a pseudo matrix of 4x4 > that is gonna work with mahalanobis? Hmmm ... I have been trying some different matrices myself now, but I keep getting the same error. Even if det(S) is very far from zero. Maybe I just do

[R] kmeans.big.matrix

2009-07-20 Thread Michael Knudsen
Hi, I'm playing around with the 'bigmemory' package, and I have finally managed to create some really big matrices. However, only now I realize that there may not be functions made for what I want to do with the matrices... I would like to perform a cluster analysis based on a big.matrix. Googlin

Re: [R] mahalanobis distance

2009-07-20 Thread ekinakoglu
Thank you for your help... I try other data from my sampling but the determinant is very close to zero. I also tried to generate random numbers using MATLAB and then calculate S=var(x) to no avail. Could you please help me with a pseudo matrix of 4x4 that is gonna work with mahalanobis? Thanks..

Re: [R] a complicated merging task

2009-07-20 Thread Sarah Goslee
Why not merge on ID, then delete the rows that don't match your second criterion? Seems easier than trying to do it in one step. Sarah On Mon, Jul 20, 2009 at 3:07 PM, tathta wrote: > > I would like to merge two dataframes, but i have a condition that needs to > used for the merge as well. > > th

Re: [R] calculating median with a condition

2009-07-20 Thread Chuck Cleland
On 7/20/2009 2:59 PM, Manisha Brahmachary wrote: > Hello, > > > > I am trying to calculate the median of numbers across each row for the data > shown below , with the condition that if the number is negative, that it > should be ignored and the median should be taken of only the positive > num

Re: [R] calculating median with a condition

2009-07-20 Thread James W. MacDonald
Hi Manisha, Manisha Brahmachary wrote: Hello, I am trying to calculate the median of numbers across each row for the data shown below , with the condition that if the number is negative, that it should be ignored and the median should be taken of only the positive numbers. For eg: dat

Re: [R] Re gression using age and Duration of disease as a continous factors

2009-07-20 Thread Greg Snow
If you need an explanation of what regression means, then you need to take a course or 2 at your local university, or at least hire a statistical consultant. If you understand regression and just need the explanation of how to do it using R, then read section 11 (as well as everything else) of "

[R] a complicated merging task

2009-07-20 Thread tathta
I would like to merge two dataframes, but i have a condition that needs to used for the merge as well. the rows (observations) in each dataframe are identified by each person's ID and by the date of the observation. Basically I would like it to be merged based on both ID (exact match) and date

[R] calculating median with a condition

2009-07-20 Thread Manisha Brahmachary
Hello, I am trying to calculate the median of numbers across each row for the data shown below , with the condition that if the number is negative, that it should be ignored and the median should be taken of only the positive numbers. For eg: data is in Column A,B,C. Column D and E demonst

Re: [R] Write in file matrices of sifferent size

2009-07-20 Thread Jorge Ivan Velez
Dear Julien, Try sink(): matrixA <- matrix(0,5,4) matrixB <- matrix(1,7,13) matrixList <- list(matrixA,matrixB) names(matrixList) <- c("matrixA", "matrixB") sink("yourname.txt") matrixList sink() See ?sink for more information. HTH, Jorge On Mon, Jul 20, 2009 at 1:02 PM, julien cuisin

[R] Re gression using age and Duration of disease as a continous factors

2009-07-20 Thread 1Rnwb
Please explain me as what it means and how this analysis can be done using R and which library(ies) are needed. Thanks -- View this message in context: http://www.nabble.com/Regression-using-age-and-Duration-of-disease-as-a-continous-factors-tp24574133p24574133.html Sent from the R help mailing

[R] Tinn-R - problem with hotkeys

2009-07-20 Thread Dimitri Liakhovitski
I've just installed R on my new laptop. Then, I've installed the latest version of Tinn-R. It works but - when I go to R-hotkeys, it does not alllow me to specify any hotkeys. I click in the field that says "None" (on top), try to change it, but it does not allow me to do anything. Has anyone encou

Re: [R] Write in file matrices of sifferent size

2009-07-20 Thread jim holtman
use capture.output > matrixA <- matrix(0,5,4) > matrixB <- matrix(1,7,13) > matrixList <- list(matrixA,matrixB) > names(matrixList) <- c("matrixA", "matrixB") > matrixList $matrixA [,1] [,2] [,3] [,4] [1,]0000 [2,]0000 [3,]0000 [4,]00

Re: [R] Write in file matrices of sifferent size

2009-07-20 Thread Steve Lianoglou
Hi, On Jul 20, 2009, at 1:02 PM, julien cuisinier wrote: Hi list, How to save a list content into a text file? Please consider example below, I have two numeric matrices that I bundle into a list & give each list element a name Example: matrixA <- matrix(0,5,4) matrixB <- matrix(1,7,13)

Re: [R] heatmap plot

2009-07-20 Thread 1Rnwb
since heatmap is a graphic image it needs the "graphics" library. you can see these two in the examples for heatmap. require(graphics); require(grDevices) Markus Mühlbacher wrote: > > Dear R community! > > I am trying to create a heatmap based on the following data. As you can > see the diago

Re: [R] Can I use "mcnemar.test" for 3*3 tables (or is there a bug in the command?)

2009-07-20 Thread Tal Galili
Hello David, Thank you for your patience with the amount of ignorance I am revealing of myself in my questions, and for your willingness to help. My replies to your e-mail are bellow, prefaced with "T:" for ease of navigation. On Mon, Jul 20, 2009 at 9:02 PM, David Winsemius wrote: > > On Jul

Re: [R] dot plot with several points for 2 categories

2009-07-20 Thread 1Rnwb
I use the long way, you might have to play around with my script to get is correct. once you get it to work, you can add as many points to reflect, median, percentile etc. ## generatiing vectors for Group1 a<-LMMP8[Self_T1D=="N"] w <- a[!is.na(a)] length(w) c<-mean(a, na.rm=TRUE) c

Re: [R] assign question

2009-07-20 Thread Albyn Jones
I don't think you want assign() here. > x1 = rnorm(20) > min(x1) [1] -0.9723398 > min(eval(paste("x",1,sep=""))) # not the solution [1] "x1" > min(eval(as.name(paste("x",1,sep="" # a solution [1] -0.9723398 try: for(i in 1:27) { xener[i] <- min(eval(as.name((paste("sa",i,sep="")

[R] Write in file matrices of sifferent size

2009-07-20 Thread julien cuisinier
Hi list, How to save a list content into a text file? Please consider example below, I have two numeric matrices that I bundle into a list & give each list element a name Example: > matrixA <- matrix(0,5,4) > matrixB <- matrix(1,7,13) > matrixList <- list(matrixA,matrixB) > n

Re: [R] assign question

2009-07-20 Thread David Huffer
How about: sapply ( 1:27 , function ( i ) { min ( get ( paste ( "sa" , i , sep = "" ) ) ) } ) See ?get david -- David   - David Huffer, Ph.D. Senior Statistician CSOSA/Washington, D

[R] Simulate residuals with different properties for a linear model (regression)

2009-07-20 Thread Friedericksen Hope
Hey guys, for educational purposes I wonder if it is possible to simulate different data sets (or specifically residuals) for a linear regression. I would like to show my students residuals with different means, variances and distributions (normal, but also not normal) in the plots created with t

Re: [R] I might be dumb : a simple question about "foreach"

2009-07-20 Thread David M Smith
A user in Japan reported a similar problem on the Revolutions blog ( http://bit.ly/FKP2I ), and my best guess is that it's an (unintended!) effect of using locales. The developers in New Haven are looking at it, and I expect they'll be able to post an update to CRAN soon. # David Smith On Mon, Jul

[R] assign question

2009-07-20 Thread Erin Hodgess
Dear R People: I have several vectors, sa1, sa2,...sa27 of varying lengths. I want to produce one vector xener[1:27] which has the minimum of each sa[i]. I'm trying to set up a loop and use the assign statement, but here are my results: > for(i in 1:27) { + xener[i] <- min(assign(paste("sa",i,s

Re: [R] Normalize data

2009-07-20 Thread Bert Gunter
Start by using the Help docs and functionality, not this list. ?help.search help.search("scale") ?scale Bert Gunter Genentech Nonclinical Biostatistics -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Noah Silverman Sent: Monday,

Re: [R] Normalize data

2009-07-20 Thread milton ruser
require(vegan) library(help=vegan) :-) On Mon, Jul 20, 2009 at 2:03 PM, Noah Silverman wrote: > Hello, > > I'm coming from RapidMiner, so some of the "easy" things there are a bit > difficult for me to find in R > > How do I normalize data in a data frame. Ideally I want to scale the > values f

[R] Normalize data

2009-07-20 Thread Noah Silverman
Hello, I'm coming from RapidMiner, so some of the "easy" things there are a bit difficult for me to find in R How do I normalize data in a data frame. Ideally I want to scale the values for each column in the range of (-1,1) Thank You, __ R-hel

Re: [R] Can I use "mcnemar.test" for 3*3 tables (or is there a bug in the command?)

2009-07-20 Thread David Winsemius
On Jul 20, 2009, at 5:22 AM, Tal Galili wrote: Hello David Winsemius and the rest of the R help group, David, I tried to answer your question to the best of my abilities, If I was unclear or still am leaving some things out, please help me in focusing my situation even further. here are my

Re: [R] heatmap plot

2009-07-20 Thread Michael Knudsen
2009/7/20 Markus Mühlbacher : > Gives the attached image. Again I am missing the white diagonal. Is there > some kind of sorting that I do not consider? Maybe col=c("white",heat.colors(100)) will do the trick? -- Michael Knudsen micknud...@gmail.com http://lifeofknudsen.blogspot.com/

Re: [R] Solving two nonlinear equations with two knowns

2009-07-20 Thread Ravi Varadhan
I just realized that the problem occurs when b becomes smaller than -1 during iterations, causing the integral to be divergent (it is infinite at u = tau). So, you have to constrain your exponent to be greater than -1. There is no way to constrain parameters in dfsane. However, you can do a par

Re: [R] Solving two nonlinear equations with two knowns

2009-07-20 Thread Ravi Varadhan
As the error message tells you, the problem is in integrating InverseF1(). I would recommend that the you breakup the integrand into two terms, the first term with `qnorm(...)' and the second part involving the `a*(abs(u-tau))^b*(u>tau)' term. It is the second term that causes trouble . But you c

[R] randomForest - what is a 'good' pseudo r-squared?

2009-07-20 Thread lara harrup (IAH-P)
Hi all I have been trying to use the randomForest package to model insect species abundance in different habitats and identify the key variables (landscape/climate etc) in determining abundance, which has all worked fine and I get nice variable importance plots etc. Many thanks to everyone on t

[R] Argument problem in function wrapper

2009-07-20 Thread Usuario R
Dear all, we are writing a wrapper for the nls function in library stats. We are having a problem with one of the arguments (weightsArgument) which seems not to reach nls even if we explicitly assign it in the function call. We are attaching the simplest code reproducing the error and the output c

Re: [R] Entire Organization Switching from SAS to R - Any experience?

2009-07-20 Thread Frank E Harrell Jr
Jeffrey J. Hallman wrote: Hmmm, I sense a story in the offing. Was that an accidental emergency, or one you created? Frank E Harrell Jr writes: I differ with Marc in one way. It is amazing what people can learn when you create an emergency for them to do so. Frank -- Frank E Harrell Jr Pr

Re: [R] Automatically assign symbol for statistical significance to x given value of x

2009-07-20 Thread Tormod Bøe
On Mon, Jul 20, 2009 at 5:47 PM, Marc Schwartz wrote: > > The simple answer is to use symnum(), which is the function the generates > the symbology for those tables in R where the 'significance stars' are > included. For example, when printing a linear model summary where > printCoefmat() is used.

Re: [R] Another SEM question

2009-07-20 Thread Jarrett Byrnes
Luba, If you could provide the code you ran, perhaps the listserv can be of help. On Jul 20, 2009, at 7:55 AM, Stein, Luba (AIM SE) wrote: Hello, I use the function sem the following way sem.mod <- sem(model, mod.cov, N=109) where the variables are modelled: Z -> M Z -> I Z -> R M <->

Re: [R] class export in package creation / setClass / namespace?

2009-07-20 Thread L L
Thanks, the issue was solved by adding class definitions to the zzz.R file in the R code directory. However, this led to a new problem. The zzz.R now contains class definition: > setClass("myclass", contains = "list") and method definition for the new class, extending the generic 'show': > set

Re: [R] heatmap plot

2009-07-20 Thread Michael Knudsen
2009/7/20 Markus Mühlbacher : > What is my mistake? I don't know about the heatmap function, but I have often used 'image' with 'heat.colors' without any problems. There is a nice example here: http://addictedtor.free.fr/graphiques/graphcode.php?graph=20 It should be fairly easy to fit your dat

[R] sweave output

2009-07-20 Thread Rainer M Krug
Hi I am using sweave and have read somewhere a way of adding ... when printing vectors / dataframes which are longer then a given length, but I can't find this anymore. Could somebody point me into the right direction, where I could find it? Thanks Rainer -- Rainer M. Krug, Centre of Excellen

Re: [R] Naming Conventions

2009-07-20 Thread Bert Gunter
partial answer: ?make.names Also ?UseMethod for S3 related names. Bert Gunter Genentech Nonclinical Biostatistics -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of escher2079 Sent: Monday, July 20, 2009 8:40 AM To: r-help@r-project

Re: [R] what is meaning of the bubbles in boxplots?

2009-07-20 Thread Thomas Lumley
You may be looking for the range=0 argument to boxplot(). -thomas On Mon, 20 Jul 2009, Douglas Bates wrote: On Mon, Jul 20, 2009 at 5:18 AM, Jie TANG wrote: Hi ,everyone ,  I draw some boxplot figure with the command "boxplot".But in the figure,there are some bubbles at the top part of

Re: [R] Automatically assign symbol for statistical significance to x given value of x

2009-07-20 Thread Marc Schwartz
On Jul 20, 2009, at 10:36 AM, Tormod Bøe wrote: Dear r-help users, I am using Sweave and Latex to create tables with output from several statistical test. As an example: I have a grouping variable "group" with two levels ("x" and "y") which I compare on variables ("a" and "b"). I have created

Re: [R] (-8)^(1/3) == NaN?

2009-07-20 Thread Thomas Lumley
On Sun, 19 Jul 2009, jim holtman wrote: If the power that a number is being raised to is integer, then is does evaluate honoring the unary minus. (-2) ^ 5 #integer power [1] -32 (-2) ^ 5.1 [1] NaN Yes. 3 is representable exactly as a whole number, so (-2)^3 exists, but (1/3) is repres

[R] Naming Conventions

2009-07-20 Thread escher2079
Hi, I was wondering about naming conventions for functions in R. I wasn't able to find anything official, just this document, which seemed reasonable but you never know with things found on the internet: http://www1.maths.lth.se/help/R/RCC/ When submitting packages to CRAN, is there a commonly

[R] heatmap plot

2009-07-20 Thread Markus Mühlbacher
Dear R community! I am trying to create a heatmap based on the following data. As you can see the diagonal (0,0 to 10,10) is always 0). If I run the heatmap command like i posted it I get a graph with horizontal lines. What is my mistake? > heatmap(activity.matrix, Rowv = NA, Colv = NA, scale

[R] Automatically assign symbol for statistical significance to x given value of x

2009-07-20 Thread Tormod Bøe
Dear r-help users, I am using Sweave and Latex to create tables with output from several statistical test. As an example: I have a grouping variable "group" with two levels ("x" and "y") which I compare on variables ("a" and "b"). I have created a table in which means, standard deviations, and th

[R] Another SEM question

2009-07-20 Thread Stein, Luba (AIM SE)
Hello, I use the function sem the following way sem.mod <- sem(model, mod.cov, N=109) where the variables are modelled: Z -> M Z -> I Z -> R M <-> M I <-> I R <-> R Z <-> Z The output is ... Normalized Residuals Min. 1st Qu. Median Mean 3rd Qu. Max. -7.3300 -0.2750 -0.2670 -0.1290 -0.0369 9.030

Re: [R] What is the Datasets License?

2009-07-20 Thread Skipper Seabold
On Sat, Jul 18, 2009 at 6:28 PM, Duncan Murdoch wrote: > On 18/07/2009 6:06 PM, Skipper Seabold wrote: >> >> Hello, >> >> I saw that this question has been asked here before but couldn't find >> an answer.  Are the raw datasets in R in the public domain?  Most are >> based on quite old "classic" pu

[R] S4 method dispatch with inheritance

2009-07-20 Thread Michael Hahsler
Hi, I'm trying to create a new S4 class (myMatrix) which for now just extends dgCMatrix (from package Matrix). Then I want to use "[" which is defined in Matrix. Out of the box with "[" (defined in Matrix) I lose the class information and the result is an object of class dgCMatrix. If I spec

Re: [R] mahalanobis distance

2009-07-20 Thread Michael Knudsen
On Mon, Jul 20, 2009 at 3:08 PM, ekinakoglu wrote: > Error in solve.default(cov, ...) : >  system is computationally singular: reciprocal condition number = > 1.65972e-18 Try calculating the determinant of the S matrix: > det(S) [1] 2.825397e-06 It's very close to zero, and I guess that the mat

  1   2   >