Re: [R] Re gression by groups questions

2009-06-18 Thread xavier . chardon
Hi, It seems like your multivariate regression works for groups A and B. For group C, values are calculated using an interaction between x1 and x2. Try to include it in the regression model to find the right coeffs: y ~ grp:x1:x2 + grp:x1 + grp:x2 + grp - 1 It works for me. Notice in summary()

Re: [R] how to sort

2009-06-18 Thread ONKELINX, Thierry
You need both the name of the dataframe and the variable in the dataframe. dfCorTFandPCA[order(dfCorTFandPCA$PC1)] ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest

[R] Questíon regarding the use of write.csv2 , write.table ...

2009-06-18 Thread Lavri Labi
Hi all, I use "write.csv" and "write.table" to write a data frame in a file like following: write.csv2(allRandomTestCase_XDroped, "allRandomTestCase.csv") But in the created file "allRandomTestCase.csv" an additional column with consecutive numbers is automatically added to the column of the data

[R] R function found in two packages !

2009-06-18 Thread Martial Sankar
Hi, Is there a mean to automatically choose one version of the 'rbind' function ? By default, R chose the 'rbind' from {base}, i would lke to use the one from {IRanges}... Is it possible to set that using 'par' ? > ?rbind Help on topic 'rbind' was found in the following packages: Package

Re: [R] R function found in two packages !

2009-06-18 Thread Allan Engelhardt
See help("::") help("attachNamespace") and perhaps help("search") Allan. On 18/06/09 09:39, Martial Sankar wrote: > Hi, > > Is there a mean to automatically choose one version of the 'rbind' function ? > By default, R chose the 'rbind' from {base}, i would lke to use the one from > {IRanges}

[R] JRI memory leak?

2009-06-18 Thread andzsin
Dear List, R 2.8.0 JRI 0.4-1 OS WinXP Pro Java 1.6 I am calling R from Java through JRI. My process runs an iteration endlessly, and (supposedly) cleans up after each turn : rm(list=ls(all=TRUE) gc(reset=TRUE) In Java: rengine.eval("rm(list=ls(all=TRUE)); gc(reset=TRUE)"); S

Re: [R] R function found in two packages !

2009-06-18 Thread Liviu Andronic
On 6/18/09, Martial Sankar wrote: > Is there a mean to automatically choose one version of the 'rbind' function > ? By default, R chose the 'rbind' from {base}, i would lke to use the one > from {IRanges}... > I am usually solving these issues with: base::rbind() or IRanges::rbind(). Liviu ___

[R] ANOVA with replicate measures

2009-06-18 Thread João Fadista
Hi, I have the following dataset (shown only part of it): WFPSsampling dayslurry depth replicates N2O (mg/m2/h) 1 1 1 3 1 0.007 1 1 1 3 2 0.022 1 1 1 3 3 0.015 1 1 2 3

Re: [R] tiff() woes

2009-06-18 Thread Federico Calboli
On 17 Jun 2009, at 18:15, Dirk Eddelbuettel wrote: On Wed, Jun 17, 2009 at 05:29:26PM +0100, Federico Calboli wrote: Hello all, a friend has a problem with tiff() which I was unable to help about. I searched the error messages to no avail. When he tries: tiff(filename = "FedeWhyDoesntThisB

[R] Crash caused by a call to a C function

2009-06-18 Thread Christophe Genolini
Hi the list I write a function MyFunc. To optimize it, I write a C function MyFuncC then a function MyFunc2 that call .C(“MyFuncC”,….) The two functions MyFunc and MyFunc2 seem to behave exactly the same way (they give the same results). But when I test MyFunc2 several times (around 20), R cra

Re: [R] Error using getBM() to query BioMart archives

2009-06-18 Thread Martin Morgan
Please ask questions about Bioconductor packages on the Bioconductor mailing list https://stat.ethz.ch/mailman/listinfo/bioconductor Martin Aaron Wolen writes: > I'm trying to identify the positions of all genes within a specific > chromosomal region using biomart. When using the current bio

Re: [R] Questíon regarding the use of write.csv2 , write.table ...

2009-06-18 Thread Jorge Ivan Velez
Dear Lavri, Take a look at the row.names argument in ?write.table. HTH, Jorge On Thu, Jun 18, 2009 at 4:09 AM, Lavri Labi wrote: > Hi all, > > I use "write.csv" and "write.table" to write a data frame in a file like > following: > write.csv2(allRandomTestCase_XDroped, "allRandomTestCase.csv")

Re: [R] R function found in two packages !

2009-06-18 Thread Martial Sankar
Thanks, > Date: Thu, 18 Jun 2009 11:21:29 +0200 > Subject: Re: [R] R function founRd in two packages ! > From: landronim...@gmail.com > To: martial100...@hotmail.com > CC: r-help@r-project.org > > On 6/18/09, Martial Sankar wrote: > > Is there a mean to automatically choose one version of the

Re: [R] R function found in two packages !

2009-06-18 Thread Martin Morgan
Martial Sankar writes: > Hi, > > Is there a mean to automatically choose one version of the 'rbind' function ? > By default, R chose the 'rbind' from {base}, i would lke to use the one from > {IRanges}... > Is it possible to set that using 'par' ? Are you asking how to find help on IRanges::rb

[R] quantile fixed effects with weights

2009-06-18 Thread alessia matano
Dear all, I 'm implementing the koenker procedure for quantile fixed effects. I would like also to apply weights to the procedure, so that to give more weight to the observation that better represent my original sample (much larger than it is possible to use in R). Do you know if it is possible? H

Re: [R] Questíon regarding the use of write.csv2 , write.table ...

2009-06-18 Thread Lavri Labi
Dear Jorge, thank you for the quick answer. But I am afraid you didn´t understand my problem. I want to write the following data frame "exampleDataframe" in a csv2-file. "a";"b";"c";"d" 1 ; 2 ; 3 ; 4 5 ; 6 ; 7 ; 8 9 ; 0 ; 1 ; 2 After sending the command: write.csv2(exampleDataframe,file="exa

Re: [R] lattice: axis ticks, axis alignment and remove axis from plot

2009-06-18 Thread Katharina May
Hi Sorn, thanks for your code. I guess I didn't really made myself very clear. What I sort of looking for is a xyplot with both the x axis at the bottom and y axis at the left going through 0, but continuing in the positive and negative area (forming a kind of cross like e.g. http://upload.wikime

[R] lattice logaritmic scale (basis "e" ), rewriting labels using xscale.component

2009-06-18 Thread Katharina May
Hi there, sorry for troubling everybody once again, I've got a problem rewriting Sarkar's function for rewriting the tick locations in a logaritmic way (s. http://lmdvr.r-forge.r-project.org/code/Chapter08.R): His example works for log 2 but I need log e (natural logarithm). My problem is that if

Re: [R] lattice: axis ticks, axis alignment and remove axis from plot

2009-06-18 Thread Katharina May
Hi Jim, thanks, that sounds like a good idea! The only problem is that axis and pos are a far as I know not for lattice or at least I cannot find an appropriate function and way to do this in lattice. Maybe I have to keep on searching for how to realize that with lattice... Best wishes,

Re: [R] tiff() woes

2009-06-18 Thread Federico Calboli
I checked on the affected computer and both tiff and cairo capabiliies return FALSE. How that is I would not know, it's a bog standard R installation on windows XP. The 2.9.0 Windows install does not have TIFF capability. Try png() or something else. I don't know about that, but R is definit

Re: [R] Predict Fanny Membership

2009-06-18 Thread Gad Abraham
On 18/6/09 9:52 AM, Stephanie Januchowski wrote: Hello List, My question is an elementary one. I have run a fuzzy kmeans cluster using FANNY to group freshwater fish assemblages. I then went in the field to validate that classification and have retrieved new assemblage data for a new suite of st

Re: [R] Error messages/systemfit package

2009-06-18 Thread Arne Henningsen
Hi Axel, Both error messages indicate that a regression equation is singular. The error message of systemfit() indicates that the singularity appears in the first stage of the two-stage procedure. Hence, it seems that your instruments are linearly dependent. Please check this and remove some of th

Re: [R] Questíon regarding the use of write.csv2, write.table ...

2009-06-18 Thread xavier . chardon
Hi, It sounds like the first column that is "added" is actually the row names. That's why a previous answer pointed this argumented. Default for write.csv is to write the row names along with the data. So, this should work: write.csv2(exampleDataframe,file="exampleDataframe.csv", row.names=FALSE

Re: [R] recovering the name of a given value in a matrix

2009-06-18 Thread jim holtman
use 'findInterval' > x X1 X2 X3 X4 X5 X6 X8 X13 X14 X17 X40 2 4 6 7 9 11 13 14 15 16 17 > findInterval(4.25, x) [1] 2 > names(x)[2] [1] "X2" > On Wed, Jun 17, 2009 at 10:19 PM, Germán Bonilla wrote: > Hi all, > > I've got object *cumsumtab, *where the first row > (1,2,3,

Re: [R] Re gression by groups questions

2009-06-18 Thread Chris Friedl
pasting reply by Xavier into this thread for the sake of others who might come across it in their R travels. Thanks Xavier Hi, It seems like your multivariate regression works for groups A and B. For group C, values are calculated using an interaction between x1 and x2. Try to include it in the

Re: [R] Questíon regarding the use of write.csv2 , write.table ...

2009-06-18 Thread Bryan Hanson
Write.table will give you all the control you need to get exactly what you want. Bryan On 6/18/09 7:50 AM, "xavier.char...@free.fr" wrote: > Hi, It sounds like the first column that is "added" is actually the row > names. That's why a previous answer pointed this argumented. Default for > wri

Re: [R] Re gression by groups questions

2009-06-18 Thread Chris Friedl
Thanks Xavier. That's exactly the solution. xavier.chardon wrote: > > Hi, > > It seems like your multivariate regression works for groups A and B. For > group C, values are calculated using an interaction between x1 and x2. Try > to include it in the regression model to find the right coeffs

[R] RWeka memory problem

2009-06-18 Thread Christian Schulz
Hello, i get some memory problems using RWeka and i'm wondering because i have only ~ 400MB in RObjects without a high memory consuming operation when a crash occur. Look into hs_err_pid.log , it seems that the VM max heap size is only 512 mb. VM Arguments: jvm_args: -Xmx512m vfprintf exi

Re: [R] Questíon regarding the use of write.csv 2, write.tab le ...

2009-06-18 Thread Lavri Labi
Hi Xavier, thanks for your suggestion. It´s run! Lavri > Hi, > > It sounds like the first column that is "added" is actually the row names. > That's why a previous answer pointed this argumented. Default for > write.csv is to write the row names along with the data. So, this should > work: > wr

[R] filtering number of values in a data frame

2009-06-18 Thread René Schönemann
Dear list, given is the following data frame df(): Number Place Start End 1 218024740787 HHO 5 263 2008-01-02 00:21:14 2008-01-03 15:25:16 2 218024740787 HHO 5 263 2008-01-02 00:21:14 2008-01-02 00:21:14 3 318039091794 HHO 5 263 20

Re: [R] filtering number of values in a data frame

2009-06-18 Thread Andrew Dolman
Take a look at the function ?aggregate andydol...@gmail.com 2009/6/18 René Schönemann > Dear list, > > given is the following data frame df(): > >Number Place Start End > 1 218024740787 HHO 5 263 2008-01-02 00:21:14 2008-01-03 15:25:16

Re: [R] how to sort

2009-06-18 Thread onyourmark
HI Thanks! This worked: dfCorTFandPCA[order(dfCorTFandPCA$PC1),] Ony milton ruser wrote: > > Hi Ony, > > If you got a data.frame with dfCorTFandPCA=as.data.frame(corTFandPCA) > so you can try something like: > > orderedCorTFandPCA=dfCorTFandPCA[order(dfCorTFandPCA$PC1),] > > May be you can a

[R] "Normal" plot and xyplot side by side in one figure?

2009-06-18 Thread Titus v. d. Malsburg
Hi list, I want to place a plot (eg "plot(1:10)") and a xyplot side by side in one figure. The two columns should have different widths. If I'm not missing something, this rules out the standard way: par(mfcol=n). I tried layout(), but it doesn't seem to like it when grid scribbles into it

Re: [R] where/what is i? for loop (black?) magic

2009-06-18 Thread Liaw, Andy
From: Duncan Murdoch > > Liaw, Andy wrote: > > A colleague and I were trying to understand all the > possible things one > > can do with for loops in R, and found some surprises. I think we've > > done sufficient detective work to have a good guess as to > what's going > > on "underneath", but

[R] Installation reg:-

2009-06-18 Thread harish babu dharmalingan
Hi, There is a problem installing R. I am using windows vista home basic. After installation and when i'm trying to access it, it shows "Fatal error: cannot mkdir R_Tempdir" and after pressing ok, it closes. Can anyone help me out? Regards, Harish [[alternative HTML versio

[R] Problem reading from a file

2009-06-18 Thread Nick Angelou
Hi all, I have written a function cluster_compare(myfile, mclfile) I called it giving names of files in the working directory (I see them with dir()). I get Error in file("myfile", "r") : cannot open the connection In addition: Warning message: In file("myfile", "r") : cannot open file 'myf

[R] filtering number of values in a data frame

2009-06-18 Thread Schönemann , Rene
Dear list, given is the following data frame df(): Number Place Start End 1 218024740787 HHO 5 263 2008-01-02 00:21:14 2008-01-03 15:25:16 2 218024740787 HHO 5 263 2008-01-02 00:21:14 2008-01-02 00:21:14 3 318039091794 HHO 5 263 20

[R] win.metafile() and family

2009-06-18 Thread Simon Pickett
Hi all, I recently discovered how great win.metafile is for getting high resolution graphics into word. Having problems with specifying families though... #pdf works fine pdf("test.pdf",width=14,height=9) par(family="Helvetica") plot(1:10) text(4,4,"trial") dev.off() windows 2 #metafil

[R] SSOAP access to a j2EE-ws service

2009-06-18 Thread Olivier Cailloux
I am currently trying to access a SOAP web service (hosted on a JBoss5 server and defined as a J2EE-ws service) via the SSOAP R-package. But all I can get is a NULL answer. The web service seems to work as it can be accessed using a general web-service tester. The web service wsdl is here: htt

Re: [R] Problem reading from a file

2009-06-18 Thread David Winsemius
1) What is the rest of your code ... e.g. that part which sets up the file names and at least the parameters and file access parts of the function cluster_compare? PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, rep

[R] Any method to speed up this problem?

2009-06-18 Thread njhuang86
Hi all, Suppose I have a vector like this: [1] "STAT1" "STAT1" "STAT1" "STAT1" "GAPDH" "GAPDH" "GAPDH" "ACTB" "ACTB" [10] "ACTB" "DDR1" "RFC2" "HSPA6" "PAX8" "GUCA1A" "UBE1L" "THRA" "PTPN21" [19] "CCL5" "CYP2E1" "STAT1" "THRA" "PAX8" I would like to produce a vector

Re: [R] filtering number of values in a data frame

2009-06-18 Thread Simon Pickett
I think you can then use merge() to merge them back together n<- merge(n, df, by.x = c("m.values"), by.y = c("Start"), all.x = F, all.y = F) also see ?aggregate for a more efficient solution. HTH, Si. - Original Message - From: "Schönemann, Rene" To: Sent: Thursday, June 18, 2009

Re: [R] Any method to speed up this problem?

2009-06-18 Thread Marc Schwartz
On Jun 18, 2009, at 9:28 AM, njhuang86 wrote: Hi all, Suppose I have a vector like this: [1] "STAT1" "STAT1" "STAT1" "STAT1" "GAPDH" "GAPDH" "GAPDH" "ACTB" "ACTB" [10] "ACTB" "DDR1" "RFC2" "HSPA6" "PAX8" "GUCA1A" "UBE1L" "THRA" "PTPN21" [19] "CCL5" "CYP2E1" "STAT1"

[R] Significance asterisk in a bar plot

2009-06-18 Thread Gilad
Hi all, How do I add an asterisk representing a significant difference to a barplot? Cheers, Gil [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the postin

Re: [R] quantile fixed effects with weights

2009-06-18 Thread roger
On Jun 18, 2009, at 5:01 AM, alessia matano wrote: Dear all, I 'm implementing the koenker procedure for quantile fixed effects. Who he? Wuz 'dat? I would like also to apply weights to the procedure, so that to give more weight to the observation that better represent my original sample (

Re: [R] Any method to speed up this problem?

2009-06-18 Thread jim holtman
Here is a way of determining where the dups are: > vec <- scan(textConnection(' "STAT1" "STAT1" "STAT1" "STAT1" "GAPDH" "GAPDH" "GAPDH" + + "ACTB" "ACTB" "ACTB" "DDR1" "RFC2" "HSPA6" "PAX8" + "GUCA1A" "UBE1L" "THRA" "PTPN21" "CCL5" "CYP2E1" "STAT1" + "THRA" "PAX8"'), what=

Re: [R] win.metafile() and family

2009-06-18 Thread Prof Brian Ripley
Where did you get the idea that Helvetica was a Windows font family name? (It is a Linotype trademark font name.) It is rarely seen on Windows, so attempts to use it almost always end up with a font substitution, often to Arial which is already the default family in win.metafile(). That will

Re: [R] Matrix inversion-different answers from LAPACK and LINPACK

2009-06-18 Thread Avraham . Adler
Thank you. One question, though. In the case where I have closed form formulæ for the Hessian, or the functions are parseable by "deriv3", would it be better to use that than the approximation? --Avraham "

[R] r scripting

2009-06-18 Thread Jon Erik Ween
Hi! I have a dataset with some 300+ variables and 2000+ records. I'd like to grind through a bunch of analyses on the variables by using a script, but can't figure out how to refer to variable names properly. For some of the simpler stuff I use various "apply" functions, but for others (like t-tes

Re: [R] Problem in 'Apply' function: does anybody have other solution

2009-06-18 Thread jude.ryan
David Winsemius' solution: > apply(data.matrix(df), 1, I) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] x12345678910 y13456789 10 2 For y and [,2] above the value is 3. Why is the value not 2? It look

Re: [R] Significance asterisk in a bar plot

2009-06-18 Thread Henrique Dallazuanna
If I understand correctly, you can try something about like this: x <- c(1, 4, 5, 10) bp <- barplot(x, ylim = c(0, max(x) + 2)) text(bp, x, labels = symnum(x, cutpoints = c(1, 5, 10), symbols = c("*", "**")), pos = 3) On Thu, Jun 18, 2009 at 12:40 PM, Gilad wrote: > Hi all, > > How

[R] Can I estimate strength and correlation of Random Forest in R package " randomForest"?

2009-06-18 Thread Li GUO
Hello! I want to estimate strength and correlation of RandomForest, but in package "randomForest" there is not an interface to get it. I think I must to change the source code. Is there any advise? Thanks, Li [[alternative HTML version deleted]]

[R] Print column headers of summary

2009-06-18 Thread nmset
Hello, This is a newbee question. I would simply like to write in a text file the headers of the summary function along with the computed data. write(summary(x), file="out.txt") gives only the data. I have not found a solution on the forum. Thank you for any help. -- View this message in con

Re: [R] Problem in 'Apply' function: does anybody have other solution

2009-06-18 Thread David Winsemius
It's not a solution. Unfortunately data.matrix is no different with respect to factors than other functions. Note what str(df) produced for df$y. -- David. On Jun 18, 2009, at 10:59 AM, wrote: David Winsemius' solution: > apply(data.matrix(df), 1, I) [,1] [,2] [,3] [,4] [,5] [,6]

Re: [R] "Normal" plot and xyplot side by side in one figure?

2009-06-18 Thread Greg Snow
Look at the gridBase package. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Titus v. d. Malsburg > Sent: Thu

Re: [R] Problem in 'Apply' function: does anybody have other solution

2009-06-18 Thread jude.ryan
Thanks! I did not look at the output of str(df) closely. Since y is defined as a character variable when df is created (but stored as a factor), it looks like str(df) is sorting the factors, at least when it is displayed to the screen. Jude -Original Message- From: David Winsemius [mailto

Re: [R] merging data.frames of different length

2009-06-18 Thread Don MacQueen
The word "merge" in the context of R suggests the use of the merge() function, but I don't think that's the right tool for what you want. The merge() function is for relational database type merges, which for your data would have a many to many merge. Not good. In terms of the R language, you'

Re: [R] r scripting

2009-06-18 Thread Christian Schulz
Hi, perhaps that is what you want? > df <- as.data.frame(matrix(runif(100),ncol=10)) > form <- as.formula(paste(names(df)[length(df)], "~ .")) > lm(form,data=df) Call: lm(formula = form, data = df) Coefficients: (Intercept) V1 V2 V3 V4 -1.367 -

Re: [R] Print column headers of summary

2009-06-18 Thread Marc Schwartz
On Jun 18, 2009, at 10:05 AM, nmset wrote: Hello, This is a newbee question. I would simply like to write in a text file the headers of the summary function along with the computed data. write(summary(x), file="out.txt") gives only the data. I have not found a solution on the forum. Tha

[R] Learning S3

2009-06-18 Thread Hadley Wickham
Hi all, Do you know of any good resources for learning how S3 works? I've some how become familiar with it by reading many small pieces, but now that I'm teaching it to students I'm wondering if there are any good resources that describe it completely, especially in a reader-friendly way. So far

Re: [R] Significance asterisk in a bar plot

2009-06-18 Thread Frank E Harrell Jr
Gilad wrote: Hi all, How do I add an asterisk representing a significant difference to a barplot? Cheers, Gil Bar plots are dreadful ways to present information (see http://biostat.mc.vanderbilt.edu/DynamitePlots). Don't make them worse by adding arbitrary declarations of 'significance.

[R] R networking group on LinkedIn

2009-06-18 Thread agdesilva
Greetings: I created an R group on Linkedin. It has a discussion board but a bit less about programming and more about networking including jobs but also relevant web sites. Please join us. Regards, Ajit http://www.linkedin.com/groups?about=&gid=77616&trk=anet_ug_grppro http://www.linkedin.c

Re: [R] Learning S3

2009-06-18 Thread Gabor Grothendieck
There is a section on Object Orientation in MASS (I have 2nd ed). On Thu, Jun 18, 2009 at 12:06 PM, Hadley Wickham wrote: > Hi all, > > Do you know of any good resources for learning how S3 works?  I've > some how become familiar with it by reading many small pieces, but now > that I'm teaching it

Re: [R] Learning S3

2009-06-18 Thread Henrik Bengtsson
Not a suggestion on documentation, but to ease S3 coding and hiding some of the details, you might want to consider the R.methodsS3 package. It basically provides some S3 code generators and makes it clear what class of objects a method is dispatched on. From the example code: setMethodS3("foo",

Re: [R] Matrix inversion-different answers from LAPACK and LINPACK

2009-06-18 Thread Ravi Varadhan
Of course, closed form hessian is great, but I would still check it using deriv3 or hessian() from numDeriv. It should be noted that hessian() is so accurate that it can be a surrogate for the exact hessian. It is computationally demanding, but it is tolerable when you are computing it only

Re: [R] Learning S3

2009-06-18 Thread Bert Gunter
-- or Chapter 4 in S PROGRAMMING? (you'll need to determine if it's "reader friendly") Bert Gunter Genentech Nonclinical Biostatistics -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Gabor Grothendieck Sent: Thursday, June 18, 2009

Re: [R] "Normal" plot and xyplot side by side in one figure?

2009-06-18 Thread Bert Gunter
Greg is absolutely right: Generally base and grid graphics(which is what lattice plots are based on) don't play well together, and gridBase is meant to address this. However... The problem here is specifically that the print.trellis (or synonymous plot.trellis) function that is silently invoked to

[R] Replace zeroes in vector with nearest non-zero value

2009-06-18 Thread Murali.MENON
Folks, If I have a vector such as the following: x <- c(0, -1, -1, -1, 0, 0, 1, -1, 1, 0) and I want to replace the zeroes by the nearest non-zero number to the left, is there a more elegant way to do this than the following loop? y <- x for (i in 2 : length(x)) { if (y[i] == 0) {

Re: [R] merging data.frames of different length

2009-06-18 Thread Henrique Dallazuanna
This code works for me, subset(merge(x1, x2, by = c("category", "id"), all = T), select=-id) category rnorm.10..5..2. rnorm.10..8..2. 1 1 NA7.810377 2 16.4932819.002411 3 16.4932818.397378 4 12.757321

Re: [R] Learning S3

2009-06-18 Thread Hadley Wickham
I think I remember reading that some time back and finding it confusing because it described the ideal implementation in S, rather than the actual implementation in R. I'll look at it again. Hadley On Thu, Jun 18, 2009 at 11:36 AM, Bert Gunter wrote: > -- or Chapter 4 in S PROGRAMMING? (you'll n

Re: [R] Learning S3

2009-06-18 Thread Dirk Eddelbuettel
On 18 June 2009 at 09:36, Bert Gunter wrote: | -- or Chapter 4 in S PROGRAMMING? (you'll need to determine if it's "reader | friendly") +1 It helped me a lot too back in the day. But I am wondering if there are good current alternatives. Hadley: if you could, please send a summary back to the

[R] Random number datasets help

2009-06-18 Thread Alexandre Lockhart
Hello: My problem is that I have a data frame of means, and a data frame of standard deviations which match up to each mean. I have been trying to create 500 random numbers in a given dataset for each mean/sd combination, but I am only able to generate the last value in each data set to creat

Re: [R] Replace zeroes in vector with nearest non-zero value

2009-06-18 Thread jim holtman
use na.locf in zoo: > x [1] 0 -1 -1 -1 0 0 1 -1 1 0 > # replace 0 with NA so na.locf works > is.na(x) <- x == 0 > x [1] NA -1 -1 -1 NA NA 1 -1 1 NA > na.locf(x, na.rm=FALSE) [1] NA -1 -1 -1 -1 -1 1 -1 1 1 > You can then go back and replace NAs with 0 On Thu, Jun 18, 2009 at 12:47

[R] biOps load failed after being used for one week

2009-06-18 Thread Michelle2009
Hi, I installed biOps on my XP, and installed the required dll packages, jpeg62.dll, libfftw3-3.dll, and libtiff3.dll, as suggested by this forum. Then it worked perfectly for about one week till this afternoon. When I tried to load biOps again, I got the following error message again Error in i

Re: [R] Replace zeroes in vector with nearest non-zero value

2009-06-18 Thread Gabor Grothendieck
The zoo package has na.locf which replaces NAs with the last non-NA. So, first replace 0's with NA's, apply na.locf and then replace NAs with 0's. > library(zoo) > x.na <- replace(x, x == 0, NA) > x0 <- na.locf(x.na, na.rm = FALSE) > replace(x0, is.na(x0), 0) [1] 0 -1 -1 -1 -1 -1 1 1 1 1 On

[R] Calling library functions from outside R

2009-06-18 Thread Jim Nemesh
I develop quite a bit of R code that I tend to distribute, or let other people embed in their software. One of the things I'd really like to do is find a way to load an R library I've developed, and call one function with arguments. Currently, I achieve that by building a separate R client

Re: [R] Replace zeroes in vector with nearest non-zero value

2009-06-18 Thread William Dunlap
approx() almost does what you want, but you have to patch up its output to account for a possible initial run of 0's in the input: > x <- c(0, -1, -1, -1, 0, 0, 1, -1, 1, 0) > y <- approx(seq_along(x)[x!=0], x[x!=0], xout=seq_along(x), method="const", f=0, rule=2)$y > y [1] -1 -1 -1 -1 -1 -1 1 -1

Re: [R] Random number datasets help

2009-06-18 Thread jim holtman
try this: > a1<-c(178.07,178.28,178.08,177.74,177.04,178.17,177.58,57.71,59.6,60.92,59.48,59.32,61.59,59.94,28.9,29.82,30.73,25.68,27.93,28.98,29.76,123.48,127.27,127.8,127.2,127.13,126.71,125.5) > a2<-c(1.69,1.3,1,.18,1.53,1.31,1.35,1.83,1.56,1.12,.74,1.48,1.67,1.53,.95,.87,0.03,1.12,1.95,1.22,1.

Re: [R] Calling library functions from outside R

2009-06-18 Thread Gabor Grothendieck
See the getopt R package and have a look at ?Rscript Also on Windows see Rscript.bat and #Rscript.bat in http://batchfiles.googlecode.com and on Linux see: http://dirk.eddelbuettel.com/code/littler.html On Thu, Jun 18, 2009 at 1:25 PM, Jim Nemesh wrote: > I develop quite a bit of R code that I t

Re: [R] Random number datasets help

2009-06-18 Thread Henrique Dallazuanna
Try this also: a <- expand.grid(a1, a2) x <- mapply(rnorm, n = 500, mean = a[,1], sd = a[,2]) On Thu, Jun 18, 2009 at 2:10 PM, Alexandre Lockhart < alexandre_geor...@hotmail.com> wrote: > > Hello: > > My problem is that I have a data frame of means, and a data frame of > standard deviations whic

Re: [R] Calling library functions from outside R

2009-06-18 Thread Jim Nemesh
I did look at ?Rscript. My question there was: Unfortunately, it looks like each expression is evaluated separately. Is there a way to evaluate multiple expressions in the same environment to make the above work? I could write an Rscript client file, but it's still poor CLI support compared

Re: [R] Calling library functions from outside R

2009-06-18 Thread Gabor Grothendieck
On Thu, Jun 18, 2009 at 1:54 PM, Jim Nemesh wrote: > I did look at ?Rscript.  My question there was: >>> >>> Unfortunately, it looks like each expression is evaluated separately. >>> Is there a way to evaluate multiple expressions in the same >>> environment to make the above work? > > I could writ

Re: [R] Calling library functions from outside R

2009-06-18 Thread Jim Nemesh
Actually, I'm going to take by my comments. You can use Rscript with multiple -e arguments to do what I was looking for: Rscript -e 'library(broadgap.hapmaptools)' -e 'processAllFiles(dir="/ humgen/cnp04/sandbox/steve/1m/hapmap3/genotypes/ftp.hapmap.org/genotypes/2008-07_phaseIII/hapmap_form

[R] regression with covariate

2009-06-18 Thread Martin Batholdy
hi, How can I compute a regression between x and y adding a covariate z? __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commente

Re: [R] Random number datasets help

2009-06-18 Thread Marc Schwartz
Alexandre did say 28 datasets, not 784 (28 * 28) Thus, either: mapply(rnorm, n = 500, mean = a1, sd = a2) or apply(cbind(a1, a2), 1, function(x) rnorm(500, x[1], x[2])) HTH, Marc Schwartz On Jun 18, 2009, at 12:51 PM, Henrique Dallazuanna wrote: Try this also: a <- expand.grid(a

Re: [R] Random number datasets help

2009-06-18 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf Of Henrique Dallazuanna > Sent: Thursday, June 18, 2009 10:52 AM > To: Alexandre Lockhart > Cc: r-help@r-project.org > Subject: Re: [R] Random number datasets help > > Try this also:

Re: [R] regression with covariate

2009-06-18 Thread Dylan Beaudette
Hi, take a look at the following manual pages: ?lm ?longley In general, you would use Wilkinson-Rogers notation for linear models: y ~ x + z, etc. Some nice examples here: http://data.princeton.edu/R/linearmodels.html Cheers, Dylan On Thu, Jun 18, 2009 at 11:04 AM, Martin Batholdy wrote: >

[R] Fractional Polynomials (mfp) for Weibull Model

2009-06-18 Thread Lam, Kelvin
Dear R-users, I am trying to modify the mfp() function in the mfp package to model Weibull survival using fractional polynomials approach. However, I keep getting into trouble when mfp.fit and other "hidden" functions can't be found. I did find some of them in Splus but it's getting nowhere.

Re: [R] Random number datasets help

2009-06-18 Thread David Winsemius
On Jun 18, 2009, at 1:10 PM, Alexandre Lockhart wrote: Hello: My problem is that I have a data frame of means, and a data frame of standard deviations which match up to each mean. I have been trying to create 500 random numbers in a given dataset for each mean/sd combination, but I am

Re: [R] Calling library functions from outside R

2009-06-18 Thread Dirk Eddelbuettel
On 18 June 2009 at 14:02, Jim Nemesh wrote: | Actually, I'm going to take by my comments. | | You can use Rscript with multiple -e arguments to do what I was | looking for: | | Rscript -e 'library(broadgap.hapmaptools)' -e 'processAllFiles(dir="/ | humgen/cnp04/sandbox/steve/1m/hapmap3/genot

[R] off topic but need your pointers about statistics

2009-06-18 Thread Michael
Hi all, I apologize for this off-topic question but I need your help -- I know there are lots of experts here. As a lover and student of statistics, I am thinking of building a tree of various branches of statistics and keeping track of the greatest historical inventions/discoveries in statistics

[R] Constant value in an interval

2009-06-18 Thread Katschke, Adrian R
I am calling on the R-help crew once again. The CD4Per for each subject should be the same for each subject based on a 90 day window either side of the known value. For example, ID 2931 should have a CD4Per of 36 at 0, 34, and 62 DaysEnrolled. Any ideas how to do this without a loop? ID

Re: [R] biOps load failed after being used for one week

2009-06-18 Thread Michelle2009
With help from my colleague, I found the problem. After I put another library dll, zlib1.dll, at the folder, biOps is working again now. Though it's still amazing to me why biOps worked for about one week before I had zlib1.dll. I hope message could also help people who have the same problem. Th

[R] Hatched symbols

2009-06-18 Thread Guilhem Faure
Hello, I would like to build rectangles in a plot and use color and different type of hatching for filling rectangles. I don't find the way to draw hatchings. I'm thinking to build segment by segment inside each rectangle but I'm sure that exists a better way to do that. I didn't find any document

[R] predict.glm and predict.gam output

2009-06-18 Thread Anke Konrad
Hi all, I am currently trying to compare different plant occurrence prediction maps generated in R and exported into GRASS. One of these maps was generated from a glm fitted to some data, and subsequently applying this glm model to a wider region using predict.glm. The outcome here was a prob

Re: [R] predict.glm and predict.gam output

2009-06-18 Thread David Winsemius
On Jun 18, 2009, at 3:23 PM, Anke Konrad wrote: Hi all, I am currently trying to compare different plant occurrence prediction maps generated in R and exported into GRASS. One of these maps was generated from a glm fitted to some data, and subsequently applying this glm model to a wider

Re: [R] Random number datasets help

2009-06-18 Thread jim holtman
That is not what his 'for' loops are doing. He is iterating through all combinations and would have created 784. So his problem statement did not match the code that he sent. On Thu, Jun 18, 2009 at 2:12 PM, Marc Schwartz wrote: > Alexandre did say 28 datasets, not 784 (28 * 28) > > Thus,

Re: [R] overshoot of formula line in summary output of Sweave

2009-06-18 Thread Ken Knoblauch
Ben Bolker ufl.edu> writes: > > In the Sweave output for summary for several types > > of model objects and also for the comparison of models > > with anova, I find that that the display of the call(s) > > or formula does not obey the width option, even with > > keep.source=TRUE set, so that a lon

Re: [R] r scripting

2009-06-18 Thread Don MacQueen
For the mean() example, I believe this should work (untested) for (var in names(Dataset)) print( mean( Dataset[[var]] , na.rm=TRUE ) ) or for (var in names(Dataset)) print( mean( Dataset[,var] , na.rm=TRUE ) ) But it's harder with lm, glm, and friends. For them I think maybe you can do i

Re: [R] off topic but need your pointers about statistics

2009-06-18 Thread markleeds
agresti's book ( forget which one. there are two ) has an appendix about the history of categorical data that i remember being quite interesting. that's the only one i know of. On Jun 18, 2009, Michael wrote: Hi all, I apologize for this off-topic question but I need your

  1   2   >