Re: [R] (no subject)

2010-02-12 Thread Jim Lemon
On 02/13/2010 05:49 AM, Drew Smathers wrote: Sent from my iPod Yes, I can see that's a problem. Do you really want the solution? Jim __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] How to source files from a search path?

2010-02-12 Thread blue sky
On Fri, Feb 12, 2010 at 11:41 PM, blue sky wrote: > On Fri, Feb 12, 2010 at 6:11 PM, Don MacQueen wrote: >> Well, you still will need Sys.getenv() to get the value of the environment >> variable into R. >> >> Are you familiar with the function named list.files() ? >> >> This may do the job: >> >>

Re: [R] How to source files from a search path?

2010-02-12 Thread blue sky
On Fri, Feb 12, 2010 at 6:11 PM, Don MacQueen wrote: > Well, you still will need Sys.getenv() to get the value of the environment > variable into R. > > Are you familiar with the function named list.files() ? > > This may do the job: > >   source( list.files( Sys.getenv('SOMEENVVAR'), pattern='myf

Re: [R] expand the inside of command with rep ?

2010-02-12 Thread Xu Wang
That you very much for the replies! I learned a lot. -- View this message in context: http://n4.nabble.com/expand-the-inside-of-command-with-rep-tp1476420p1517893.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org m

[R] "drop if missing" command?

2010-02-12 Thread Nora Kozloff
This will probably seem very simple to experienced R programmers: I am doing a snp association analysis and am at the model-fitting stage. I am using the Stats package's "drop1" with the following code: ##geno is the dataset ## the dependent variable (casectrln) is dichotomous and coded 0,1 ##

Re: [R] lm function in R

2010-02-12 Thread Daniel Nordlund
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Something Something > Sent: Friday, February 12, 2010 5:28 PM > To: Phil Spector; r-help@r-project.org > Subject: Re: [R] lm function in R > > Thanks for the replies everyone. Gr

Re: [R] lm function in R

2010-02-12 Thread Something Something
Thanks for the replies everyone. Greatly appreciate it. Some progress, but now I am getting the following values when I don't use "as.factor" 13.14167 25.11667 28.34167 49.14167 40.39167 66.86667 Is that what you guys get? On Fri, Feb 12, 2010 at 5:00 PM, Phil Spector wrote: > By converting

Re: [R] R - Compiling and calling Fortran code that uses IMSL libraries - Help!

2010-02-12 Thread Sharpie
Nynese Tinsley wrote: > > > Good Afternoon R Help! > > > On of my users is seriously thinking about moving to R from Splus. In his > testing, he has already found some benefits to it. He has, however run > into one issue, calling his Fortran functions in R. Previously, in Splus, > he would

[R] lm function in R

2010-02-12 Thread Something Something
Hello, I am trying to learn how to perform Multiple Regression Analysis in R. I decided to take a simple example given in this PDF: http://www.utdallas.edu/~herve/abdi-prc-pretty.pdf I created a small CSV called, students.csv that contains the following data: s1 14 4 1 s2 23 4 2 s3 30 7 2 s4 50

Re: [R] How to source files from a search path?

2010-02-12 Thread Don MacQueen
Well, you still will need Sys.getenv() to get the value of the environment variable into R. Are you familiar with the function named list.files() ? This may do the job: source( list.files( Sys.getenv('SOMEENVVAR'), pattern='myfilename') ) But I haven't tested it. -Don (and your name or a

Re: [R] data frames; maybe aggregate?

2010-02-12 Thread Phil Spector
Jonathan - split will do what you want: df <- data.frame('id'=c('a','b','a','c','b','a'),'value'=c(6,4,2,9,1,7)) split(df$value,df$id) $a [1] 6 2 7 $b [1] 4 1 $c [1] 9 Thanks for providing a reproducible example! - Phil Spector

Re: [R] Problems with savePlot() and postscript under Snow Leopard

2010-02-12 Thread Michael Denslow
Hi Hannes, > Dear all, > > I tried: >> iris >> species.n <- as.numeric(Species) >> plot(iris, col = species.n) >> savePlot(filename="IrisTestPlot", type="png") You might try quartz.save("Iris.png","png") I think this is an undocumented function that is specific to the Mac GUI. You can search th

Re: [R] How to source files from a search path?

2010-02-12 Thread blue sky
On Fri, Feb 12, 2010 at 5:28 PM, Bert Gunter wrote: > 1. Etiquette on this list is to sign posts with your real name. > > 2. Please use R's Help facilities (beyond RSiteSearch()) first before > posting: > > ?help.search > > help.search("environment variable") I guess you are referring to 'Sys.get

[R] data frames; maybe aggregate?

2010-02-12 Thread Jonathan Reichel
Hi all, Another one: Given a data frame with two columns, where the first column (let's call it 'id') has redundant entries, I'd like to get, for each unique value in 'id', a list or vector of all the values from the second column that corresponded to that value. Example: > df <- data.frame(

Re: [R] SAS and RODBC

2010-02-12 Thread Daniel Nordlund
> -Original Message- > From: Prof Brian Ripley [mailto:rip...@stats.ox.ac.uk] > Sent: Thursday, February 11, 2010 1:25 AM > To: Daniel Nordlund > Cc: r-help@r-project.org > Subject: Re: [R] SAS and RODBC > > On Thu, 11 Feb 2010, Daniel Nordlund wrote: > > > I am using R-2.10.1 binary from

[R] Problems with savePlot() and postscript under Snow Leopard

2010-02-12 Thread Hannes Nietnagel
Dear all, I tried: > iris > species.n <- as.numeric(Species) > plot(iris, col = species.n) > savePlot(filename="IrisTestPlot", type="png") and got the error message: Fehler in savePlot(filename = "IrisTestPlot", type = "png") : kann nur aus 'X11(type="*cairo")' Devices kopieren (sorry, I have

Re: [R] How to source files from a search path?

2010-02-12 Thread Bert Gunter
1. Etiquette on this list is to sign posts with your real name. 2. Please use R's Help facilities (beyond RSiteSearch()) first before posting: ?help.search help.search("environment variable") Bert Gunter Genentech Nonclinical Statistics -Original Message- From: r-help-boun...@r-proje

Re: [R] logical operations with lists

2010-02-12 Thread Iain Gallagher
these are vectors in R not lists try: a<-c('a', 'b', 'c')#first vector (like A) > a [1] "a" "b" "c" b<-c('c', 'd', 'e')#second vector (like B) > b [1] "c" "d" "e" c<-setdiff(b,a)# all those in B but not A > c [1] "d" "e" cheers iain --- On Fri, 12/2/10, Zoppoli, Gabriele (NIH/NCI) [G] wrote

Re: [R] Help with submitting HTML forms in RCurl

2010-02-12 Thread Henrique Dallazuanna
I don't get error: > postForm("http://www.expasy.ch/tools/protscale.html";, +"sequence" = "", +scale = "Molecular weight", +window = "5", +weight_edges = "100", +weight_var = "linear", +norm = "no", +submit = "Submit") [1] "\n" at

Re: [R] logical operations with lists

2010-02-12 Thread Zoppoli, Gabriele (NIH/NCI) [G]
I'm sorry but here's what I get: > A[1:10,] [1] UQCRC1 IDH3B PDHA1 SUCLA2 COX5B SDHB SDHA MDH2 DLDCOQ7 > dim(A) [1] 10131 > B[1:10,] [1] 3.8-1.2 3.8-1.3 3.8-1.4 3.8-1.5 5-HT3c2 A1BGA1CFA2BP1 A2LD1 A2M > dim(B) [1] 55546 1 > C<-rbind(A,B) > dim(C) [1] 565

[R] How to source files from a search path?

2010-02-12 Thread blue sky
Suppose some environment variable (say MY_R_INC) has a number of paths. I want to source some file relative to some path in $MY_R_INC (just as #include in C++ does, which looks for header file in a number of directories). I RSiteSearch'ed, but I don't find any function that satisfies my need. Could

[R] Need help on boxplot panel chart

2010-02-12 Thread DougNiu
Hi there: I am new to R and creating a boxplot panel chart to show a test result. I have four output variables (OV1, OV2, OV3, OV4) reflecting effects of the variation of three status parameters (SP1, SP2, SP3) on them at three different locations (Loc1, Loc2, Loc3). My plan is that displaying

[R] Interactions

2010-02-12 Thread Jaclyn Maghapon
Hi R community, I am trying to fit a PLS model with response Y and predictor X, where X consists of at least 30 columns (say x1, x2, ..., x30).  Aside from studying the relationship of Y and x1, ..., x30, I am also interested in studying the effect of quadratic terms (x1^2, ..., x30^2) and two-

[R] all possible subsets, with AIC

2010-02-12 Thread kcleary2
Hello, I have a question about doing ALL possible subsets regression with a general linear model. My goal is to produce cumulative Akaike weights for each of 7 predictor variables-to obtain this I need R to: 1. Show me ALL possible subsets, not just the best possible subsets 2. Give me an A

Re: [R] Is there a way to figure out what nonlocal variables and functions have been used in a function?

2010-02-12 Thread Sharpie
blue sky wrote: > > I don't what '{' and functions available in R libraries. I can > manually exclude '{'. Is there an easy way to exclude the functions > from R libraries? > Well, you could write a function, say isPackaged( name ), that returns TRUE or FALSE depending on whether the object ma

Re: [R] Multiple figures margin problem

2010-02-12 Thread mnstn
Hello Greg, I tried that and got a similar result. The axes are still hidden. I am studying R Intro and Fig2A and 3B in http://research.stowers-institute.org/efg/R/Graphics/Basics/mar-oma/index.htm . They seem to indicate that the "mar" parameter alone controls the visibility of axis labels. Am I

[R] Why double quote is preferred?

2010-02-12 Thread blue sky
?'`' shows the following: "Single and double quotes delimit character constants. They can be used interchangeably but double quotes are *preferred* (and character constants are printed using double quotes), so single quotes are normally only used to delimit character constants containing double qu

Re: [R] logical operations with lists

2010-02-12 Thread Iain Gallagher
sorry, misread your post try this... > c<-setdiff(a,b) > c [[1]] [1] "a" [[2]] [1] "b" for a list C that contains all the members in the list B that are not in list A --- On Fri, 12/2/10, Zoppoli, Gabriele (NIH/NCI) [G] wrote: > From: Zoppoli, Gabriele (NIH/NCI) [G] > Subject: [R] logical

Re: [R] logical operations with lists

2010-02-12 Thread Jonathan
This is probably not the best way, but (assuming you had vectors and not lists, since I'm not sure what your list looks like): C <- B[which(B %in% A ==FALSE)] Regards, Jonathan On Fri, Feb 12, 2010 at 5:06 PM, Zoppoli, Gabriele (NIH/NCI) [G] wrote: > Sorry, maybe it's easy but I haven't found

Re: [R] logical operations with lists

2010-02-12 Thread Iain Gallagher
> a<-list('a', 'b', 'c') > b<-list('c', 'd', 'e') > c<-intersect(a,b) > c [[1]] [1] "c" Is this what you want? Cheers Iain --- On Fri, 12/2/10, Zoppoli, Gabriele (NIH/NCI) [G] wrote: > From: Zoppoli, Gabriele (NIH/NCI) [G] > Subject: [R] logical operations with lists > To: "r-help@r-project

Re: [R] logical operations with lists

2010-02-12 Thread David Winsemius
On Feb 12, 2010, at 5:06 PM, Zoppoli, Gabriele (NIH/NCI) [G] wrote: Sorry, maybe it's easy but I haven't found anything useful: how can I obtain a list C that contains all the members in the list B that are not in list A? This are lists of nanes, not numbers! > A <- list("a", "b" , "c") >

Re: [R] Multiple figures margin problem

2010-02-12 Thread Greg Snow
You do want outer margins, that is where the axis labels and tick marks will go for the plots that you want. Try: par(mar=c(0,0,0,0), oma=c(5,4,1,1)+0.1) Then do your plots to see if that is what you want. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s.

[R] logical operations with lists

2010-02-12 Thread Zoppoli, Gabriele (NIH/NCI) [G]
Sorry, maybe it's easy but I haven't found anything useful: how can I obtain a list C that contains all the members in the list B that are not in list A? This are lists of nanes, not numbers! Thank you Gabriele Zoppoli, MD Ph.D. Fellow, Experimental and Clinical Oncology and Hematology, Univer

[R] popbio and stochastic lambda calculation

2010-02-12 Thread Shawn Morrison
Hello R users, I am trying to calculate the stochastic lambda for a published matrix population model using the popbio package. Unfortunately, I have been unable to match the published results. Can anyone tell me whether this is due to slightly different methods being used, or have I gone wr

[R] Multiple figures margin problem

2010-02-12 Thread mnstn
Hello All, I am trying to make a figure with 3x2 plots in it. Let us name the plots as such: 1 2 3 4 5 6 I begin my script with: par(mfcol=c(3,2)) par(oma=c(0,0,0,0)) --> This is for a postscript figure so I really don't need the outer margins. d=5 par(mar=c(d,d,d,d)) --> This applies

Re: [R] Code working but too slow, any idea for how to speed it up ?(no loop in it)

2010-02-12 Thread Dan Davison
anna hotmail.com> writes: > > Hello my friends, > here is a code I wrote with no loops on matrix that is taking too long (2 > seconds and I call him 720 times --> 12 minutes): > > mat1 and mat2 are both matrix with 103 columns and 164 rows. Could you provide some example code creating matrice

[R] Logistic regression with weights?

2010-02-12 Thread Mark Miller
I created a logistic regression model for the data set immediately below and obtained the following parameter estimates: Coefficients : Estimate Std. Error t-value Pr(>|t|) altc -0.064539 0.359398 -0.1796 0.8575 alts -0.287682 0.381881 -0.7533 0.4513 Then I reformatted the data s

Re: [R] Code find exact distribution for runs test?

2010-02-12 Thread Peter Ehlers
Here's a simple function (same idea): f <- function(x){ lenx <- length(x) negx <- sum(x < 0) mat <- matrix(1, lenx, choose(lenx,negx)) for(i in seq_len(choose(lenx, negx))){ mat[combn(lenx,negx)[, i], i] <- -1 } mat } x <- c(-1,-1,-1,1,1,1,1) f(x) [combn() is now in utils] -Pe

Re: [R] for loop function output

2010-02-12 Thread Chris Campbell
On Fri, Feb 12, 2010 at 01:26, seydahmet ercan wrote: > Hello all, > I am trying to run a simulation. the simulation presented below. > >> rep=5 >> sr=.10 # selection ratio >> pmin=.10 # minority ratio >> nap=1000 # total number of applicant >> nsle=sr*nap # number of ee selected >> nb=nap*pmin #

[R] mgcv problem

2010-02-12 Thread Rosa Manrique
My dearest, I appreciate very much a little help. I have changed my R 2.9 version to the new one R 2.10 version. I uninstall the old one, I cancel also the old library and I install everything again. When I load the package mgcv it appears the following message: This is mgcv 1.6-1. For overview t

Re: [R] Is there a way to figure out what nonlocal variables and functions have been used in a function?

2010-02-12 Thread blue sky
On Fri, Feb 12, 2010 at 1:36 PM, Sharpie wrote: > > > blue sky wrote: >> >> x=10 >> f=function() {print('in f')} >> g=function() {f(); print(x)} >> g() >> >> Suppose I have the above code, I want to know what functions and >> variables have been used in the function g (in this case, f and x). Is >

Re: [R] Access dataframe with variable name in function

2010-02-12 Thread Dennis Murphy
Hi: Hi: Observe that if you quote the name of the variable in your original function, everything is fine; in fact, you can ask for multiple variables. > k <- function(df, col) df[col] > k(testdata, 'var1') var1 1 0.91663902 2 0.60470753 3 0.09599891 > k(testdata, 'censor') censor 1

Re: [R] help with EXPASY HTML form submission in RCurl package

2010-02-12 Thread Sunando Roy
Hi Duncan, Thanks for your help. I changed the P but the output that I get is not what I expect. The form gets aborted without any actual output. I get the same result with postForm("http://www.expasy.ch/tools/protscale.html";) just with an added message that there was no input passed on. But wi

Re: [R] Formatting question for separate polygons

2010-02-12 Thread Tim Clark
Thanks Uwe! And Peter for the correction. I would never have come up with that! Tim Tim Clark Department of Zoology University of Hawaii --- On Fri, 2/12/10, Uwe Ligges wrote: > From: Uwe Ligges > Subject: Re: [R] Formatting question for separate polygons > To: "Peter Ehlers" > Cc: "Ti

Re: [R] Code working but too slow, any idea for how to speed it up ?(no loop in it)

2010-02-12 Thread Bert Gunter
?profile Bert Gunter Genentech Nonclinical Statistics -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of anna Sent: Friday, February 12, 2010 10:29 AM To: r-help@r-project.org Subject: [R] Code working but too slow, any idea for how

Re: [R] help with EXPASY HTML form submission in RCurl package

2010-02-12 Thread Duncan Temple Lang
Sunando Roy wrote: > Hi, > > I am trying to submit a form to the EXPASY protscale server ( > http://www.expasy.ch/tools/protscale.html). I am using the RCurl package and > the postForm function available in it. I have extracted the variables for > the form from the HTML source page. According to

Re: [R] Access dataframe with variable name in function

2010-02-12 Thread Sharpie
Philipp Rappold wrote: > > Sorry guys, but I have another one: > > > I want to write a function that returns a certain column of a > dataframe. The function accepts two argument: the dataframe and the > name of the column, but the column is not given as a "string" but as > a variable name.

[R] (no subject)

2010-02-12 Thread Drew Smathers
Sent from my iPod __ 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 commented, minimal, self-contained, reproducible code.

[R] Help with submitting HTML forms in RCurl

2010-02-12 Thread Sunando Roy
Hi, I am trying to submit a form to the EXPASY protscale server ( http://www.expasy.ch/tools/protscale.html). I am using the RCurl package and the postForm function available in it. I have extracted the variables for the form from the HTML source page. According to the syntax of postForm, I just n

Re: [R] expression() help

2010-02-12 Thread Thomas Lumley
On Fri, 12 Feb 2010, Peng Cai wrote: Hi All, I'm trying to use expression() for y-label in plot(). I'm not able to write Average(space)PM(subscript)10. I'm trying: ylab=expression(Average PM[10]) and its not working, because of a space between "Average" and "PM". Thanks, quote("Average PM"[

[R] Access dataframe with variable name in function

2010-02-12 Thread Philipp Rappold
Sorry guys, but I have another one: I want to write a function that returns a certain column of a dataframe. The function accepts two argument: the dataframe and the name of the column, but the column is not given as a "string" but as a variable name. EXAMPLE -- > testd

Re: [R] Code working but too slow, any idea for how to speed it up ?(no loop in it)

2010-02-12 Thread Ravi Varadhan
First of all, please send a reproducible code. Your code is wrong and it does not execute: naming a function called "function" is a bad idea. Ravi. Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatric Medicine and

Re: [R] using mle2 for multinomial model optimization

2010-02-12 Thread Ben Bolker
Ravi Varadhan jhmi.edu> writes: > > > Use "Nelder-Mead" as the method in optim. This will give you the correct solution. > > m1 <- mle2(mfun, start=svec, vecpar=TRUE, fixed=svec[1:(l-1)], > method="Nelder") > > Hope this is helpful, > Ravi. > {Resending because it doesn't seem to have g

[R] help with EXPASY HTML form submission in RCurl package

2010-02-12 Thread Sunando Roy
Hi, I am trying to submit a form to the EXPASY protscale server ( http://www.expasy.ch/tools/protscale.html). I am using the RCurl package and the postForm function available in it. I have extracted the variables for the form from the HTML source page. According to the syntax of postForm, I just n

Re: [R] using mle2 for multinomial model optimization

2010-02-12 Thread Ben Bolker
Ravi Varadhan jhmi.edu> writes: > > > Use "Nelder-Mead" as the method in optim. This will give you the correct solution. > > m1 <- mle2(mfun, start=svec, vecpar=TRUE, fixed=svec[1:(l-1)], > method="Nelder") > > Hope this is helpful, > Ravi. Well-meaning though it is, this solution doesn'

Re: [R] Assign Name of Data Frame

2010-02-12 Thread Mike Harwood
Marc, Thank you for your help. I had tried "assign", but I did not enclose the table name in quotes in my function call. I needed to see what someone else had written before I ever would have noticed it! On Fri, Feb 12, 2010 at 10:00 AM, Marc Schwartz wrote: > On Feb 12, 2010, at 8:19 AM, mah

[R] Execution timing in .First()

2010-02-12 Thread gerald . jean
Hello, I have a .First function in my personnal Rprofile file. Through the .First function I want to load an R data base at position 2 in the search list but R complains with: "Attempting to load the environment 'package:stats'" and further down the initialization process, when .First.sys() is

Re: [R] Code find exact distribution for runs test?

2010-02-12 Thread Greg Snow
Here is one quick way using the combinat package: > library(combinat) > > tmpfun <- function(x) { + tmp <- rep(1,5) + tmp[x] <- -1 + tmp + } > > combn(5,2, tmpfun) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] -1 -1 -1 -111111 1 [2,] -111

Re: [R] Is there a way to figure out what nonlocal variables and functions have been used in a function?

2010-02-12 Thread Sharpie
blue sky wrote: > > x=10 > f=function() {print('in f')} > g=function() {f(); print(x)} > g() > > Suppose I have the above code, I want to know what functions and > variables have been used in the function g (in this case, f and x). Is > there a function to do so? > > Try findGlobals() from t

[R] svm and RMSE

2010-02-12 Thread Amy Hessen
Hi, Every time I run a svm regression program, I got different RMSE value. Could you please tell me what the reason for that? Cheers, Amy _ If it exists, you'll find it on SEEK. Australia

Re: [R] Sweave

2010-02-12 Thread R Heberto Ghezzo, Dr
Thanks to Prof Ripley, I modified Rprofile.site with: .First <- function() { Sys.setenv("JAGS_HOME"=replace.substring.wild(R.home(), "R-*", "JAGS-1.0.3")) Sys.setenv("LATEX"=replace.substring.wild(R.home(),"R*","PortableUSB/PortableApps/MikeTex/miktex/bin/latex.exe")) PathNew <- paste(Sys.getenv

[R] Code working but too slow, any idea for how to speed it up ?(no loop in it)

2010-02-12 Thread anna
Hello my friends, here is a code I wrote with no loops on matrix that is taking too long (2 seconds and I call him 720 times --> 12 minutes): mat1 and mat2 are both matrix with 103 columns and 164 rows. sequence <- matrix(seq(1 : ncol(mat1))) returns <- apply(sequence, 1, function, mat1= mat1,

[R] Y average in plot

2010-02-12 Thread Mohsen Jafarikia
Hello All: Can somebody please tell me how I can have the average of 'y' on the graph for different values of 'x in the following code? ofn <- "xy.png" bitmap(ofn, type = "png256", width = 21, height = 30, pointsize = 30, bg = "white",res=50) ifn <- sprintf("xy.txt") data <- read.table(ifn)

Re: [R] summary statistics for grouped data

2010-02-12 Thread William Revelle
At 6:44 PM +0100 2/12/10, Søren Højsgaard wrote: You might find the summaryBy function in the doBy package useful. Regards Søren see also the describe.by function in the psych package. Fra: r-help-boun...@r-project.org [r-help-boun...@r-project.org] P

[R] R - Compiling and calling Fortran code that uses IMSL libraries - Help!

2010-02-12 Thread Nynese Tinsley
Good Afternoon R Help! On of my users is seriously thinking about moving to R from Splus. In his testing, he has already found some benefits to it. He has, however run into one issue, calling his Fortran functions in R. Previously, in Splus, he would do the following: 1. Compile via f90 the

Re: [R] expression() help

2010-02-12 Thread Henrique Dallazuanna
Try this: expression(Average~PM[10]) On Fri, Feb 12, 2010 at 3:29 PM, Peng Cai wrote: > Hi All, > > I'm trying to use expression() for y-label in plot(). I'm not able to write > Average(space)PM(subscript)10. I'm trying: > > ylab=expression(Average PM[10]) > > and its not working, because of a s

Re: [R] summary statistics for grouped data

2010-02-12 Thread Søren Højsgaard
You might find the summaryBy function in the doBy package useful. Regards Søren Fra: r-help-boun...@r-project.org [r-help-boun...@r-project.org] På vegne af jose romero [jlauren...@yahoo.com] Sendt: 12. februar 2010 18:23 Til: r-help@r-project.org Emne: [R

Re: [R] paired wilcox test on each row of a large dataframe

2010-02-12 Thread Dan Davison
gauravbhatti hotmail.com> writes: > > > hI > I have to calculate V statistic for each row of a large dataframe > (28000). I can not use multtest package for paired wilcox test. I have > been using for loop which are. Is there a way to speed the computation > with another method like using appl

Re: [R] summary statistics for grouped data

2010-02-12 Thread Greg Snow
There are several depending on what specifically you want to do. Some of the things to look at include: tapply, aggregate, the plyr package. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r

Re: [R] validate (rms package) using step instead of fastbw

2010-02-12 Thread Ramon Diaz-Uriarte
Thanks for clarifying it Frank. (Yes, no univariate screening prior to feeding the model to validate. And the "bias correct" I guess is from my spanglish factory of new terminology ;-) Best, R. On Fri, Feb 12, 2010 at 6:26 PM, Frank E Harrell Jr wrote: > Ramon Diaz-Uriarte wrote: >> >> Frank,

[R] expression() help

2010-02-12 Thread Peng Cai
Hi All, I'm trying to use expression() for y-label in plot(). I'm not able to write Average(space)PM(subscript)10. I'm trying: ylab=expression(Average PM[10]) and its not working, because of a space between "Average" and "PM". Thanks, Peng [[alternative HTML version deleted]] _

Re: [R] validate (rms package) using step instead of fastbw

2010-02-12 Thread Frank E Harrell Jr
Ramon Diaz-Uriarte wrote: Frank, let me make sure I understand: On Fri, Feb 12, 2010 at 5:57 PM, Frank E Harrell Jr wrote: Ramon Diaz-Uriarte wrote: Dear Frank, Thanks a lot for your response. And apologies for the question, because the answer was obviously in the help. As for the caveats

[R] summary statistics for grouped data

2010-02-12 Thread jose romero
Hello list: Is there an easy way (preferably through one of the standard R packages) of obtaining summary statistics for grouped data? I could split the data into classes by hist, and then progressively calculate all the "columns" i need to obtain the mean and standard deviation, but i was look

Re: [R] Access variables by string

2010-02-12 Thread Philipp Rappold
Thanks a lot guys, looks like there are -as usual- a gazillion options ;)) f = function(x, vars) x[complete.cases(x[vars]),] seems to be the most appropriate in my case though. Best Philipp Benilton Carvalho wrote: On Thu, Feb 11, 2010 at 4:18 PM, Philipp Rappold wrote: Dear all, I have

Re: [R] Selective load of .First() function just for Rgui.exe

2010-02-12 Thread Duncan Murdoch
On 12/02/2010 11:22 AM, jgar...@ija.csic.es wrote: Hi all, I have a .First <- function() {...} in the Rprofile.site file. Through .First() I'm adding several menus to the GUI to access several functions I've been developing for own use. However, I also need to launch R scripts silently in a bat

Re: [R] validate (rms package) using step instead of fastbw

2010-02-12 Thread Ramon Diaz-Uriarte
Frank, let me make sure I understand: On Fri, Feb 12, 2010 at 5:57 PM, Frank E Harrell Jr wrote: > Ramon Diaz-Uriarte wrote: >> >> Dear Frank, >> >> Thanks a lot for your response. And apologies for the question, >> because the answer was obviously in the help. >> >> As for the caveats on selec

[R] paired wilcox test on each row of a large dataframe

2010-02-12 Thread gauravbhatti
hI I have to calculate V statistic for each row of a large dataframe (28000). I can not use multtest package for paired wilcox test. I have been using for loop which are. Is there a way to speed the computation with another method like using apply or tapply? My data set looks like this:

Re: [R] Using contour3d: axes, plotting to file, with lattice

2010-02-12 Thread Waichler, Scott R
> Some of the examples in the JSS paper http://www.jstatsoft.org/v28/i01 > might be useful for integrating contour3d results with lattice. Thank you, Luke, for pointing me to your paper with examples beyond what is in R help. The example of using contour3d and wireframe in lattice in Section 4.4

Re: [R] validate (rms package) using step instead of fastbw

2010-02-12 Thread Frank E Harrell Jr
Ramon Diaz-Uriarte wrote: Dear Frank, Thanks a lot for your response. And apologies for the question, because the answer was obviously in the help. As for the caveats on selection: yes, thanks. I think I am actually closely following your book (eg., pp. 249 to 253), and one of the points I am t

Re: [R] Sweave

2010-02-12 Thread Prof Brian Ripley
I've never heard of 'Portable MikeTex'. Is this (Portable) MiKTeX? What you are doing wrong is declaring texidvi to be pdflatex, and it simply is not. I think what you actually want is to include the MiKTeX bin directory in your path, or to set options(texi2dvi=) to the path to texi2dvi.exe

Re: [R] validate (rms package) using step instead of fastbw

2010-02-12 Thread Ramon Diaz-Uriarte
Dear Frank, Thanks a lot for your response. And apologies for the question, because the answer was obviously in the help. As for the caveats on selection: yes, thanks. I think I am actually closely following your book (eg., pp. 249 to 253), and one of the points I am trying to make to my colleagu

Re: [R] using mle2 for multinomial model optimization

2010-02-12 Thread Ravi Varadhan
Use "Nelder-Mead" as the method in optim. This will give you the correct solution. m1 <- mle2(mfun, start=svec, vecpar=TRUE, fixed=svec[1:(l-1)], method="Nelder") Hope this is helpful, Ravi. Ravi Varadhan, Ph.D. Assistant

Re: [R] heplot3d / rgl : example causes R GUI to crash

2010-02-12 Thread Michael Friendly
Duncan Murdoch wrote: I tracked this down. It's a bug in rgl, but likely also a bug in heplots. At line 93 of heplot3d.mlm.R, called from line 198 in the same file, there's a call texts3d(x[which.max(x[,2]),] + offset*ranges, adj=0, texts=label, color=col, lit=FALSE) At this poin

[R] Sweave

2010-02-12 Thread R Heberto Ghezzo, Dr
Hello, I am trying to start using Sweave. I copy the example from help Sweave testfile <- system.file("Sweave", "Sweave-test-1.Rnw", package = "utils") ## enforce par(ask=FALSE) options(device.ask.default=FALSE) ## create a LaTeX file Sweave(testfile) ## This can be compiled to PDF

[R] Selective load of .First() function just for Rgui.exe

2010-02-12 Thread jgarcia
Hi all, I have a .First <- function() {...} in the Rprofile.site file. Through .First() I'm adding several menus to the GUI to access several functions I've been developing for own use. However, I also need to launch R scripts silently in a batch way, and in this case I get the error message: "E

Re: [R] How to get the source code for the assignment of a variable?

2010-02-12 Thread blue sky
On Fri, Feb 12, 2010 at 1:38 AM, Sharpie wrote: > > > djhurio wrote: >> >> I believe there is not such thing as source code for a variable. I believe >> if you define x=y*y, x is keeping only the values of y*y, but not how they >> were computed. Am I right? >> > > In general yes.  Basic variables

Re: [R] Using seq_len() vs 1:n]

2010-02-12 Thread Henrik Bengtsson
If S+ has seq(length=...), that would solve any parsing problems. /Henrik On Fri, Feb 12, 2010 at 4:59 PM, William Dunlap wrote: > The next version of S+ will have seq_len in > it.  Currently the CSAN package Rcompat contains > it. > > Parsing the name seq_len can be a problem, since > S+ 8.1 sti

Re: [R] Using seq_len() vs 1:n]

2010-02-12 Thread William Dunlap
The next version of S+ will have seq_len in it. Currently the CSAN package Rcompat contains it. Parsing the name seq_len can be a problem, since S+ 8.1 still allows the use of the underscore for assignment (it warns about its use, but allows it). Either parse your code file in R mode by calling

Re: [R] Assign Name of Data Frame

2010-02-12 Thread Marc Schwartz
On Feb 12, 2010, at 8:19 AM, mah wrote: > Hello R Experts, > > How can I assign the name of a data frame with the argument of a > function? Specifically I am using RODBC to build local dataframes > from SAS datasets on a > remote server. I would like the local dataframe have the same name as >

Re: [R] List to matrix or to vectors conversion

2010-02-12 Thread Dan davison
manchester.ac.uk> writes: > > On 12-Feb-10 13:14:29, Juan Tomas Sayago wrote: > > Dear list, > > I have a list with 1000 x1000 lines and columns Lists have neither lines nor columns. Can you explain exactly what you have? E.g. show us the code that created your "list"? > do you know how I can

[R] Is there a way to figure out what nonlocal variables and functions have been used in a function?

2010-02-12 Thread blue sky
x=10 f=function() {print('in f')} g=function() {f(); print(x)} g() Suppose I have the above code, I want to know what functions and variables have been used in the function g (in this case, f and x). Is there a function to do so? __ R-help@r-project.org

Re: [R] Potential problem with subset !!!

2010-02-12 Thread Douglas Bates
On Fri, Feb 12, 2010 at 9:22 AM, Arnaud Mosnier wrote: > Dear useRs, > > Just a little post to provide the answer of a problem that took me > some time to resolve ! > Hope that reading this will permit the others to avoid that error. > > When using the subset function, writing > > subset (data, da

[R] Assign Name of Data Frame

2010-02-12 Thread mah
Hello R Experts, How can I assign the name of a data frame with the argument of a function? Specifically I am using RODBC to build local dataframes from SAS datasets on a remote server. I would like the local dataframe have the same name as the source SAS dataset, and the function below is what

[R] Potential problem with subset !!!

2010-02-12 Thread Arnaud Mosnier
Dear useRs, Just a little post to provide the answer of a problem that took me some time to resolve ! Hope that reading this will permit the others to avoid that error. When using the subset function, writing subset (data, data$columnname == X) or subset (data, columnname == X) do the same thin

Re: [R] Using contour3d: axes, plotting to file, with lattice

2010-02-12 Thread luke
Some of the examples in the JSS paper http://www.jstatsoft.org/v28/i01 might be useful for integrating contour3d results with lattice. luke On Thu, 11 Feb 2010, Waichler, Scott R wrote: I am looking for examples of how to plot with contour3d() to a PNG or PDF file, add axes and other elements

Re: [R] trouble with read.table and colClasses='raw'

2010-02-12 Thread Henrik Bengtsson
The OP may be interested in using low-level readBin() and writeBin() instead. One can then either assign dimension attributes to the object to access the data as a matrix/an array. Note that assigning dimension attributes will probably(?) allocate a copy. If that is not wanted, it is not that ha

[R] Thread-safeness of unif_rand()?

2010-02-12 Thread Sebastian Bauer
Hello, I'm currently using the unif_rand() function of R to get a random number from the uniform distribution in the C-part of a R package. The unif_rand() is heavily used. Now I would like to spawn several threads within the package in which the function is also heavily used. Is it safe and

Re: [R] validate (rms package) using step instead of fastbw

2010-02-12 Thread Frank E Harrell Jr
Ramon Diaz-Uriarte wrote: Dear All, For logistic regression models: is it possible to use validate (rms package) to compute bias-corrected AUC, but have variable selection with AIC use step (or stepAIC, from MASS), instead of fastbw? More details: I've been using the validate function (in the

Re: [R] How to: highlight R syntax on webpages ?

2010-02-12 Thread Linlin Yan
I have saw it now. Thank you for your excellent works. On Fri, Feb 12, 2010 at 9:15 PM, Tal Galili wrote: > Hi Linlin, > I am afraid I wasn't clear. > In my post I fixed the current WP-Syntax plugin so it WILL support the R > syntax :) > The link to the article is: > http://www.r-statistics.com/2

Re: [R] List to matrix or to vectors conversion

2010-02-12 Thread Ted Harding
On 12-Feb-10 13:14:29, Juan Tomas Sayago wrote: > Dear list, > I have a list with 1000 x1000 lines and columns do you know how I can > convert it to matrrix or data.frame. > Thanks. > Juan as.data.frame() will convert it to a dataframe. If you then apply as.matrix() to the result you will get a ma

  1   2   >