[R] drawing hmms

2009-07-09 Thread rajesh j
Hi, I need to draw hmm's in R.I also need to include a small plot near each state of the hmm.How can I do this? -- Rajesh.J [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] how to transpose a dataframe

2009-07-09 Thread milton ruser
Hi roachyang, you need to be more precise on your email. But believe that you tryed one of the funtions like reshape or transform and the output has been printed on your R session. If your dataset are large, is better you assign your output on a object - like myobj<-reshape(...) - and then save yo

[R] Problem loading ReadImages package (and RGooglemaps)

2009-07-09 Thread Paul.Rustomji
Hello All I have just tried to install the ReadImages packge in R but am getting an error message stating: "This application has failedt to start because jpeg62.dll was not found. Re-installing the application may fix this problem" and at the R prompt this error message gets returned: > loca

[R] how to create 3d graph w/ spherical coordinates?

2009-07-09 Thread Buzz Buzzerr
Are there any R-routines/packages that will do 3d graphics for data in spherical coordinates? I have had no luck with Google searches. Thanks in advance for your reply. Buz [[alternative HTML version deleted]] __ R-help@r-project.org maili

Re: [R] how to transpose a dataframe

2009-07-09 Thread roachyang
Seems like this is the one, though I'm not sure how to use it. Bill.Venables wrote: > > Look at the 'reshape' package, with functions melt() and cast() > > (I'm not sure how the remark about the virtues of SAS is relevant, but if > you really want SAS, I presume you know where to find it.) > _

[R] pcaNNet confusion

2009-07-09 Thread matsumotoN
Hi. Can anyone suggest how to use the output of pcaNNet() to construct a confusion matrix possibly using confusionMatrix()? Thank you. -- View this message in context: http://www.nabble.com/pcaNNet-confusion-tp24422000p24422000.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] How to Populate List

2009-07-09 Thread Gaurav Kumar
Hi Rolf, My apologies for the inconvenience caused  due to  my reply @ "R-help diges". Thanks for providing me a clue to solve the problem . I modify a bit to  populate a list. This is throwing an error # Error in `*tmp*`[[j]] : subscript out of bounds" myData <- read.table("table.data",   

Re: [R] 'scan' in a script?

2009-07-09 Thread Daniel Nordlund
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Mark Knecht > Sent: Thursday, July 09, 2009 9:35 PM > To: jim holtman > Cc: r-help > Subject: Re: [R] 'scan' in a script? > > On Thu, Jul 9, 2009 at 6:05 PM, jim holtman wrote: >

Re: [R] naming of columns in R dataframe consisting of mixed data (alphanumeric and numeric)

2009-07-09 Thread Moshe Olshansky
Hi Mary, Your data.frame has just one column (not 2)! You can check this by dim(tresult2). What appears to you to be the first column (names) are indeed rownames. If you really want to have two columns do something like tresult2 <- cbind(colnames(tresult),data.frame(t(tresult),row.names=NULL))

Re: [R] 'scan' in a script?

2009-07-09 Thread Mark Knecht
On Thu, Jul 9, 2009 at 6:05 PM, jim holtman wrote: > If you want the value printed in the script, then use the 'print' function: > > print(MyNames) > > There is an implicit 'print' when you type an object's name at the > command line, but with you have it within a script, you have to > explicitly p

Re: [R] Population pyramids

2009-07-09 Thread Victor Manuel Garcia Guerrero
Wonderful!!! It works!!! Thank you very much Daniel. I owe you one. Cheers Victor De: Daniel Malter [mailto:dan...@umd.edu] Enviado el: jue 09/07/2009 10:44 Para: Victor Manuel Garcia Guerrero; r-help@r-project.org Asunto: AW: [R] Population pyramids Victo

Re: [R] Population pyramids

2009-07-09 Thread Victor Manuel Garcia Guerrero
Thanks Jim, I'll try it and I'll keep you informed. All the best, Victor De: Jim Lemon [mailto:j...@bitwrit.com.au] Enviado el: jue 09/07/2009 05:54 Para: Victor Manuel Garcia Guerrero CC: r-help@r-project.org Asunto: Re: [R] Population pyramids Victor Man

[R] error: optim(rho, n2ll.rho, method = method, control = control, beta = parm$beta, : initial value in 'vmmin' is not finite

2009-07-09 Thread Brandy Lee Aven
I am trying to use the lnam autocorrelation model from the SNA package. I have it running for smaller adjacency matrices (<1,500) it works just fine but when my matrices are bigger 4000+. I get the error: > lnam1_01.adj<- lnam(data01$adopt,x01,ec2001.csr) Error in optim(rho, n2ll.rho, method =

Re: [R] How to get function from lm object?

2009-07-09 Thread Marc Schwartz
On Jul 9, 2009, at 8:20 PM, Alexander V Stolpovsky wrote: Thank you much for the useful pointers. Turns out, I can get what I want with predict(fit, newdata = newdata). But for the record, there is no way to get the fit function, from lm object, is there? Alex Alex, There is no function

Re: [R] how to transpose a dataframe

2009-07-09 Thread Bill.Venables
Look at the 'reshape' package, with functions melt() and cast() (I'm not sure how the remark about the virtues of SAS is relevant, but if you really want SAS, I presume you know where to find it.) From: r-help-boun...@r-project.org [r-help-boun...@r-projec

Re: [R] how to transpose a dataframe

2009-07-09 Thread Henrique Dallazuanna
try this: transform(stack(DF, select = -level), values = DF$level) On Thu, Jul 9, 2009 at 10:30 PM, roachyang wrote: > > I want to transpose a dataframe like > level 2006 2007 2008 >A >B . >C > into > levelyear >

Re: [R] how to transpose a dataframe

2009-07-09 Thread milton ruser
Hi there, ?reshape do the job. bests milton On Thu, Jul 9, 2009 at 9:31 PM, roachyang wrote: > > I want to transpose a dataframe like > level 2006 2007 2008 >A >B . >C > into > levelyear >A 2006 >

Re: [R] how to transpose a dataframe

2009-07-09 Thread Rolf Turner
On 10/07/2009, at 1:31 PM, roachyang wrote: I want to transpose a dataframe like level 2006 2007 2008 A B . C into levelyear A 2006 A 2007 A 2008 B 2006

Re: [R] file.copy returning "FALSE"?

2009-07-09 Thread Duncan Murdoch
On 09/07/2009 9:53 PM, Jonathan Greenberg wrote: I'm running the command: file.copy(fnhdr,outdir,overwrite=TRUE) Which successfully copies the file I want to the directory I want, but each time it prints "FALSE" -- what does this mean, and how do I suppress this output? It means the ope

Re: [R] corspatial

2009-07-09 Thread Kingsford Jones
On Thu, Jul 9, 2009 at 6:12 PM, Kitty Lee wrote: > > Hi. I have a dataset of unique coordinates (no missing coordinates). When I > did the following: > > lonlat<-mydata[, c("lon, "lat")] > sp1<-corSpatial(1,form=~lon+lat,type="g") > scor<-Initialize(sp1, lonlat , nugget=FALSE) > > I got a value fo

Re: [R] How to get function from lm object?

2009-07-09 Thread Alexander V Stolpovsky
Thank you much for the useful pointers. Turns out, I can get what I want with predict(fit, newdata = newdata). But for the record, there is no way to get the fit function, from lm object, is there? Alex - This transmission may contain information that i

[R] how to transpose a dataframe

2009-07-09 Thread roachyang
I want to transpose a dataframe like level 2006 2007 2008 A B . C into levelyear A 2006 A 2007 A 2008 B 2006 B 2007 .. There is

[R] file.copy returning "FALSE"?

2009-07-09 Thread Jonathan Greenberg
I'm running the command: file.copy(fnhdr,outdir,overwrite=TRUE) Which successfully copies the file I want to the directory I want, but each time it prints "FALSE" -- what does this mean, and how do I suppress this output? --j -- Jonathan A. Greenberg, PhD Postdoctoral Scholar Center for

[R] Clustering within part of a cluster result

2009-07-09 Thread Albert Vernon Smith
How can I cluster and order within part of a previous clustering result? For example, I am clustering and ordering results as follows: > rows <- 30 > cols <- 3 > x <- matrix(sample(-1:1,rows*cols,replace=T), nrow=rows, > ncol=cols,dimnames=list(c(paste("R",1:rows,sep="")),c(paste("C",1:cols,sep=

[R] rateratio

2009-07-09 Thread Fabio Luciani
Hello I am having problems with the function rateratio in epitools I getthe following error Error in ratetable(x, rev = rev) : All arguments to ratetable() must be the same length I checked that x is a 2x2 matrix. any idea? thanks Fabio Fabio Luciani Postdoctoral NHMRC research fellow Cen

Re: [R] 'scan' in a script?

2009-07-09 Thread jim holtman
If you want the value printed in the script, then use the 'print' function: print(MyNames) There is an implicit 'print' when you type an object's name at the command line, but with you have it within a script, you have to explicitly print it. On Thu, Jul 9, 2009 at 5:08 PM, Mark Knecht wrote: >

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

2009-07-09 Thread L L
Dear all, I have been trying to create an R package. This has been successfull until I tried to define classes. Currently, my procedure is the following: Start R, load the function and class definition >tmp <- function (x) {x} >setClass("rpa", contains = "list", where=topenv(parent.frame())) Us

Re: [R] Stratified data summaries

2009-07-09 Thread Dylan Beaudette
Hi, the plyr package is your friend. Here is a tutorial on a related subject: http://casoilresource.lawr.ucdavis.edu/drupal/node/836 cheers, Dylan On Thursday 09 July 2009, Hayes, Rachel M wrote: > Hi All, > > > > I'm trying to automate a data summary using summary or describe from the > HMisc

Re: [R] Substituting numerical values using `apply'

2009-07-09 Thread Moshe Olshansky
Let M be your matrix. Do the following: B <- t(matrix(colnames(a),nrow=ncol(M),ncol=nrow(M))) B[M==0] <- NA --- On Thu, 9/7/09, Olivella wrote: > From: Olivella > Subject: [R] Substituting numerical values using `apply' > To: r-help@r-project.org > Received: Thursday, 9 July, 2009, 6:25 AM

[R] corspatial

2009-07-09 Thread Kitty Lee
Hi. I have a dataset of unique coordinates (no missing coordinates). When I did the following: lonlat<-mydata[, c("lon, "lat")] sp1<-corSpatial(1,form=~lon+lat,type="g") scor<-Initialize(sp1, lonlat , nugget=FALSE) I got a value for sp1 (2.67). But got an error message for scor--Error in getC

Re: [R] Strange t-test error: "grouping factor must have exactly 2 levels" while it does...

2009-07-09 Thread Marc Schwartz
On Jul 9, 2009, at 5:04 PM, Tymek W wrote: Hi, Could anyone tell me what is wrong: length(unique(mydata$myvariable)) [1] 2 and in t-test: (...) Error in t.test.formula(othervariable ~ myvariable, mydata) : grouping factor must have exactly 2 levels I re-checked the code and still d

Re: [R] How to get function from lm object?

2009-07-09 Thread Marc Schwartz
On Jul 9, 2009, at 6:18 PM, Alexander V Stolpovsky wrote: Dear experts, I am trying to obtain a function from a model, so that I could further manipulate it, plot it, etc. I can get model estimates and manually construct a function, but this gets tedious when trying out different functio

Re: [R] How to combine two rows (in a dataframe) into a third row?

2009-07-09 Thread Henrique Dallazuanna
Try this: aggregate(x["VALUE"], list(substr(x[,"ID"], 1, 1)), sum) On Thu, Jul 9, 2009 at 7:27 PM, Mark Na wrote: > Dear R-helpers, > > I have two rows in my dataframe: > > IDVALUE > 1A10 > 1B15 > > and I would like to combine these two rows into a single (new) row in my > dataframe

[R] How to get function from lm object?

2009-07-09 Thread Alexander V Stolpovsky
Dear experts, I am trying to obtain a function from a model, so that I could further manipulate it, plot it, etc. I can get model estimates and manually construct a function, but this gets tedious when trying out different functions to fit the data. There must be a better way of doing it, no?

[R] nls, reach limit bounds

2009-07-09 Thread UyenThao Nguyen
Hi, I am trying to fit a 4p logistic to this data, using nls function. The function didn't freely converge; however, it converged if I put a lower and an upper bound (in algorithm port). Also, the b1.A parameter always takes value of the upper bound, which is very strange. Has anyone experience

[R] Comparing Probit and Logit Coefficients Across Groups

2009-07-09 Thread OSTERFELD Marius
Hi, I want to compare probit coefficients across groups with the method proposed by Allison (1999). The method corrects for unobserved heterogeneity in binary regression models. I can find only a SAS macro on the author's homepage (http://www.ssc.upenn.edu/~allison/glogit.sas). Has anyone of yo

Re: [R] Converting indices of a matrix subset

2009-07-09 Thread Nathan S. Watson-Haigh
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Steven, This looks great. Thanks! Nathan Steve Lianoglou wrote: > Hi Nathan, > > On Jul 8, 2009, at 10:20 PM, Nathan S. Watson-Haigh wrote: > >> I have two matrices: >> >>> m1 <- matrix(1,4,4) >>> m1 >> [,1] [,2] [,3] [,4] >> [1,]1

Re: [R] Compiling R-2.9.1 on Mac OS X 10.4

2009-07-09 Thread Sinha, Raktim, DFCI
Matt & Don -- Thanks a lot for the comments. I think I need to figure out why JRI is not recognizing the R installation as shared library build first, and go from there. I will try post back on r-sig-mac if I need too. Best, Raktim -Original Message- From: Marc Schwartz [mailto:marc_schw

Re: [R] 'scan' in a script?

2009-07-09 Thread Gabor Grothendieck
Check out: http://tolstoy.newcastle.edu.au/R/help/03a/6855.html On Thu, Jul 9, 2009 at 2:24 PM, Mark Knecht wrote: > When I use the scan function in the Rgui console it works as expected. > However it seems that when I put the same command in a script file it > doesn't wait for input. > > Is ther

Re: [R] datadist() in Design library

2009-07-09 Thread array chip
Dear Jorge, Yes, with "data=beta.final" in the lrm(), it worked. But I thought one of the reasons for datadist() is to make it unnecessary to specify the data frame in the lrm(). Maybe I am completely wrong here. Thanks John --- On Thu, 7/9/09, Jorge Ivan Velez wrote: > From: Jorge Ivan Vel

[R] validate() in Design library

2009-07-09 Thread array chip
Hi, another question about validate() in Design library. The arugment "B" of this function is number of repetition for method="bootstrap", which is easy to understand; but for method="crossvalidation", B is the number of groups of omitted observations. This is confusing, I don't understand what

Re: [R] How to combine two rows (in a dataframe) into a third row?

2009-07-09 Thread Peter Alspach
Tena koe Mark ?tapply with the index argument some suitable substring of your ID column. HTH Peter Alspach > -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Mark Na > Sent: Friday, 10 July 2009 10:28 a.m. > To: r-help@

Re: [R] datadist() in Design library

2009-07-09 Thread Jorge Ivan Velez
Dear John, Have you tried it specifying the 'data' argument as suggested in lrm help? Try this: lrm(Disease ~ gsct + apcct + rarct, data = beta.final, x = TRUE, y = TRUE ) HTH, Jorge On Thu, Jul 9, 2009 at 6:46 PM, array chip wrote: > > Hi I got an error message using datadist() from Des

[R] Stratified data summaries

2009-07-09 Thread Hayes, Rachel M
Hi All, I'm trying to automate a data summary using summary or describe from the HMisc package. I want to stratify my data set by patient_type. I was hoping to do something like: Describe(myDataFrame ~ patient_type) I can create data subsets and run the describe function one at a time

Re: [R] Executing an error prone function without stopping a script

2009-07-09 Thread Duncan Murdoch
Tolga I Uzuner wrote: Dear R Users, I've used this a long time ago but have forgotten. Trawling aroung the various sources somehow does not lead me to it. How can I execute an error prone function without stopping a script if it goes wrong ? See ?try. Duncan Murdoch Thanks in advance,

[R] datadist() in Design library

2009-07-09 Thread array chip
Hi I got an error message using datadist() from Design package: > library(Design,T) > dd <- datadist(beta.final) > options(datadist="dd") > lrm(Disease ~ gsct+apcct+rarct, x=TRUE, y=TRUE) Error in eval(expr, envir, enclos) : object "Disease" not found All variables inclduing response

[R] SSOAP failure

2009-07-09 Thread nermin sarlak
Hi, I’m using R package SSOAP to retrieve data from web services. I’m using the code below to > >> >> # R code ### library(SSOAP) then I call the nwis.R which exists in SSOAP example folder. However system gives me following errors: Error in parse (text=paste(

[R] How to combine two rows (in a dataframe) into a third row?

2009-07-09 Thread Mark Na
Dear R-helpers, I have two rows in my dataframe: IDVALUE 1A10 1B15 and I would like to combine these two rows into a single (new) row in my dataframe: IDVALUE 125 ...simply by specifying a new value for ID and summing the two VALUES. I have been trying to do this with with

[R] Strange t-test error: "grouping factor must have exactly 2 levels" while it does...

2009-07-09 Thread Tymek W
Hi, Could anyone tell me what is wrong: > length(unique(mydata$myvariable)) [1] 2 > and in t-test: (...) Error in t.test.formula(othervariable ~ myvariable, mydata) : grouping factor must have exactly 2 levels > I re-checked the code and still don't get what is wrong. Moreover, there is som

Re: [R] 'scan' in a script?

2009-07-09 Thread Mark Knecht
Jim, In Rgui there is a feature to create a new script so I open that and get a blank editor. I put these commands in the script MyNames = scan(what="") MyNames Whether I ask Rgui to run the whole script as a script - not sourced - it runs the first command, doesn't wait for input and then

Re: [R] X-axis labels not displayed when changing ylim

2009-07-09 Thread Patrick Connolly
On Thu, 09-Jul-2009 at 05:36PM +0200, Sarah Bonnin wrote: > Dear R users, > > I am encountering a x axis labeling problem on quite basic plots... > I use the following code which displays the labels on the x-axis with a > 45 degrees angle: > > p <- plot(myobject1, type="b", col="red",cex=1, lwd=

[R] Lattice xyplot: same scales within one factor

2009-07-09 Thread OB
I am using R 2.8.1 and lattice to produce xyplots conditioned on two factors. What I would like is to have the scales be free between values of one factor, but some within. Thus, in this example, xyplot(mpg ~ disp | factor(gear) + factor(cyl), mtcars,     scales=list(x=list(relation="free")))

Re: [R] Issues with file.info?

2009-07-09 Thread Rolf Turner
On 10/07/2009, at 6:02 AM, Jason Rupert wrote: Are there any tricks associated with file.info? I just tried it on a directory folder and it returned NA for all fields for all files. I tried it on a different folder with different files and it still returned NA. I tried it on a specific

Re: [R] Issues with file.info?

2009-07-09 Thread Jason Rupert
Issue was with an entire directory/folder or list of files in a directory. It seemed to work fine for a single file or being sent a single file/folder. I will try to generate some example code to demonstrate the problem. Thanks again for all the replies. --- On Thu, 7/9/09, jim holtman

Re: [R] How to Populate List

2009-07-09 Thread Rolf Turner
On 10/07/2009, at 2:55 AM, Gaurav Kumar wrote: Hi, I'm new to R and would like to know, how one can populate the list with array data. I'm reading a tab separated table in R. The data in the table looks something like this. #Table Data CompABC Extracellular1032685

Re: [R] Issues with file.info?

2009-07-09 Thread jim holtman
Works fine for me on 2.9.1: > file.info('/jph') size isdir mode mtime ctime atime exe /jph0 TRUE 777 2009-06-29 15:15:13 2008-02-14 09:31:26 2009-07-09 15:57:04 no > On Thu, Jul 9, 2009 at 2:02 PM, Jason Rupert wrote: > > Are there any tricks associat

Re: [R] 'scan' in a script?

2009-07-09 Thread jim holtman
Exactly how are you using it? How you executing your script? Are you using cut/paste or source? Have you tried 'readline'? More details on what you mean by it does not work as expected. On Thu, Jul 9, 2009 at 2:24 PM, Mark Knecht wrote: > When I use the scan function in the Rgui console it wor

Re: [R] naming of columns in R dataframe consisting of mixed data (alphanumeric and numeric)

2009-07-09 Thread Etienne B. Racine
Mary A. Marion-2 wrote: > > Hello, > > I have an r function that creates the following dataframe tresults2. > Notice that column 1 does not have a column heading. > > Tresults2: > [,1] > estparam 18.0 > nullval 20.0 > . . . > ciWidth 2.04622 > HalfInter

Re: [R] Reading from Google Docs

2009-07-09 Thread Johannes Huesing
Gabor Grothendieck [Wed, Jul 08, 2009 at 10:31:30PM CEST]: [...] > >>> > >>>    [[alternative HTML version deleted]] > > __ > R-help@r-project.org mailing list > https://stat.et

Re: [R] Compiling R-2.9.1 on Mac OS X 10.4

2009-07-09 Thread Don MacQueen
I used to build from source on Mac OS X, but I stopped when I found I could do everything I needed to do from the binary on CRAN. That includes building my own packages that use fortran, or building the one or two CRAN packages that use C code and do not have Mac binaries on CRAN. In addition

[R] Lattice xyplot: same scales within one factor

2009-07-09 Thread Orion Buske
I am using R 2.8.1 and lattice to produce xyplots conditioned on two factors. What I would like is to have the scales be free between values of one factor, but some within. Thus, in the example: xyplot(mpg ~ disp | factor(gear) + factor(cyl), mtcars, scales=list(x=list(relation="free")))

Re: [R] Substituting numerical values using `apply'

2009-07-09 Thread Santiago Olivella
Thank you all for your help. SO. Henrique Dallazuanna wrote: > Try this: > > sapply(names(DF), function(n)ifelse(DF[,n] %in% c(1, 2), n, NA)) > > Where DF is your data.frame > > On Wed, Jul 8, 2009 at 5:25 PM, Olivella > wrote: > > > Hello, > > I wish to perfor

[R] 'scan' in a script?

2009-07-09 Thread Mark Knecht
When I use the scan function in the Rgui console it works as expected. However it seems that when I put the same command in a script file it doesn't wait for input. Is there an option to scan to make it wait for input when used in a script? Or is there possibly a different function that will do in

Re: [R] Compiling R-2.9.1 on Mac OS X 10.4

2009-07-09 Thread Marc Schwartz
On Jul 9, 2009, at 12:12 PM, Sinha, Raktim, DFCI wrote: Hello, I am trying to compile R-2.9.1 on Mac OS-X 10.4 using --enable-R- shlib. I am not comfortable with Mac/Linux environments and trying to follow the instructions from CRAN site to every detail. The Mac OS did not have a gcc

[R] Issues with file.info?

2009-07-09 Thread Jason Rupert
Are there any tricks associated with file.info? I just tried it on a directory folder and it returned NA for all fields for all files. I tried it on a different folder with different files and it still returned NA. I tried it on a specific file and it returned all the proper info correctly

[R] Compiling R-2.9.1 on Mac OS X 10.4

2009-07-09 Thread Sinha, Raktim, DFCI
Hello, I am trying to compile R-2.9.1 on Mac OS-X 10.4 using --enable-R-shlib. I am not comfortable with Mac/Linux environments and trying to follow the instructions from CRAN site to every detail. The Mac OS did not have a gcc (gcc -version did not work). So I did the following: ## Fo

Re: [R] more than one mathematical annotation into a legend

2009-07-09 Thread Zhiliang Ma
On Thu, Jul 9, 2009 at 9:39 AM, Thomas Roth (geb. Kaliwe) wrote: try this: legend(4,4, expression(t[m] == x, t[n] == x)) cheers, Zhiliang > Dear members, > > Is there a way to put more than one mathematical annotation into a legend > together with a calculated value? > > x = 2 > plot(1:10) > > #

[R] X-axis labels not displayed when changing ylim

2009-07-09 Thread Sarah Bonnin
Dear R users, I am encountering a x axis labeling problem on quite basic plots... I use the following code which displays the labels on the x-axis with a 45 degrees angle: p <- plot(myobject1, type="b", col="red",cex=1, lwd=2, axes=FALSE, ann=FALSE, ylim=c(0,70)) title(main="title", font.mai

Re: [R] executing an error prone function without stopping a script

2009-07-09 Thread cls59
TU wrote: > > Dear R Users, > > I've used this a long time ago but have forgotten. Trawling aroung the > various sources somehow does not lead me to it. How can I execute an error > prone function without stopping a script if it goes wrong ? > > Thanks in advance, > Tolga > > See ?try Ba

Re: [R] Tex fonts in R plots

2009-07-09 Thread cls59
KARAVASILIS GEORGE wrote: > > Hello, R users. > I would like to display the font of Math Mode of MikTex 2.3, WinEdt 5.4 > in R plots, e.g. in xlab, ylab or legend. > How can I do that? > Thank you in advance. > > A colleague and I have developed a package called pgfSweave that turns R plots

Re: [R] Creating and Using Objects in R

2009-07-09 Thread Gabor Grothendieck
Here it is done without S3. Note that UseMethod is basically just an alternative to an if statement. Perhaps this makes it more understandable. x1 <- list(x = 1, y = 2) class(x1) <- "xypoint" x2 <- list(r = 1, theta = pi/2) class(x2) <- "rthetapoint" XPOS <- function(x) { if (inherits(x,

[R] executing an error prone function without stopping a script

2009-07-09 Thread Tolga I Uzuner
Dear R Users, I've used this a long time ago but have forgotten. Trawling aroung the various sources somehow does not lead me to it. How can I execute an error prone function without stopping a script if it goes wrong ? Thanks in advance, Tolga This email is confidential and subject to import

[R] more than one mathematical annotation into a legend

2009-07-09 Thread Thomas Roth (geb. Kaliwe)
Dear members, Is there a way to put more than one mathematical annotation into a legend together with a calculated value? x = 2 plot(1:10) #Works legend(8, 8, substitute(t[m] == x)) #does not work legend(4,4, c(substitute(t[m] == x), substitute(t[n] == x))) Thanks Thomas Roth __

Re: [R] R-help Digest, Vol 77, Issue 9

2009-07-09 Thread Lauri Nikkinen
Thanks, this worked!!! nBooks <- xl[["Workbooks"]]$Count(); for (i in seq_len(nBooks)) xl[["Workbooks"]]$item(i)$Close(SaveChanges=FALSE); -L 2009/7/9 Bengoechea Bartolomé Enrique (SIES 73) : > Hi, > > This may be due to several reasons. That I can think about: > > 1) Ensure you close *a

Re: [R] How to: initialize, setValidity, copy-constructor

2009-07-09 Thread Martin Morgan
Hi Renaud -- Renaud Gaujoux writes: > Hello list, > > I'm having troubles setting up a basic calss hierarchy with S4. > Here is a simplified schema of what I'd like to do: > > - Two classes: A and B that extends A > - Ensure that the slots added by B are consistent with the slots of A > - Let A

[R] Executing an error prone function without stopping a script

2009-07-09 Thread Tolga I Uzuner
Dear R Users, I've used this a long time ago but have forgotten. Trawling aroung the various sources somehow does not lead me to it. How can I execute an error prone function without stopping a script if it goes wrong ? Thanks in advance, Tolga This email is confidential and subject to impor

Re: [R] Extracting a column name in loop?

2009-07-09 Thread mister_bluesman
Thank you both for that. Much appreciated. mister_bluesman wrote: > > Hi, > > I am writing a script that will address columns using syntax like: > > data_set[,1] > > to extract the data from the first column of my data set, for example. > This code will be placed in a loop (where the colum

[R] assigning vector name by increasing index in loop

2009-07-09 Thread cbc123
Hello I have a large data table that I wish to divide in to vectors, as in v1 v2 v3 v4 v5 id11 2 34 5 id26 7 8 9 10 newv1 <- c(table[1,1], table[3,1], table [5,1]) newv2<-c(table[1,2], table[3,2]. table[5,2]) ...an

Re: [R] math symbols in R

2009-07-09 Thread Bert Gunter
?plotmath Bert Gunter Genentech Nonclinical Biostatistics -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Mary A. Marion Sent: Thursday, July 09, 2009 12:04 PM To: r-help@r-project.org Subject: [R] math symbols in R Hello, I woul

[R] Creating and Using Objects in R

2009-07-09 Thread Lorenzo Isella
Dear All, I am not very into object-oriented programming, but I would like to learn the ropes for some R applications. Quoting from the online R language definition (paragraph 5.1) Consider the following simple example. A point in two-dimensional Euclidean space can be specified by its Cartesi

Re: [R] correct way to subset a vector

2009-07-09 Thread Marc Schwartz
On Jul 9, 2009, at 10:40 AM, Juliet Hannah wrote: Hi, #make example data dat <- data.frame(matrix(rnorm(15),ncol=5)) colnames(dat) <- c("ab","cd","ef","gh","ij") If I want to get a subset of the data for the middle 3 columns, and I know the names of the start column and the end column, I can d

[R] Logistic Regression: Likelihoo-Ratio Based Confidence Intervals

2009-07-09 Thread alex the lipenator
Hello! I hope this email finds you all well.  I have a rather elementary question.  I am interested in obtaining likelihood ratio-based confidence intervals of logistic regression parameter estimates (i.e., the MLE).  How do I specify likelihood ratio CIs in the "confint()" function, or do I ne

[R] math symbols in R

2009-07-09 Thread Mary A. Marion
Hello, I would like R software to printout a sentence including a statement such as Ho: mu=5 vs Ha: mu ne 5 where ne stands for the math symbol notequal and mu is greek letter for u. How to do? Most of the help questions I have seen have been those involving graphs. Thank you. Sincerely, Mary

Re: [R] T.test error help

2009-07-09 Thread Uwe Ligges
Daniel Malter wrote: put another condition in your loop if(all.equal(x,y)=TRUE) i=i+1 else t.test... something in that direction. Sorry, but that's neither valid R code nor sensible in this case. See my suggestions below. best, daniel - cuncta stricte discu

Re: [R] wordStem problems in R 2.9, Fedora 11; Linux Kernel 2.6.29.5-191.fc11.i586

2009-07-09 Thread Reitsma, Rene - COB
Duncan, Thanks for helping. I reinstalled Rstem from source (using the omegahat URL) and this time things are working. :-) RR -Original Message- From: Duncan Temple Lang [mailto:dun...@wald.ucdavis.edu] Sent: Tuesday, July 07, 2009 5:33 PM To: Reitsma, Rene - COB Cc: r-help@r-project

Re: [R] correct way to subset a vector

2009-07-09 Thread Steve Lianoglou
Hi, On Jul 9, 2009, at 11:40 AM, Juliet Hannah wrote: Hi, #make example data dat <- data.frame(matrix(rnorm(15),ncol=5)) colnames(dat) <- c("ab","cd","ef","gh","ij") If I want to get a subset of the data for the middle 3 columns, and I know the names of the start column and the end column, I

Re: [R] T.test error help

2009-07-09 Thread Daniel Malter
put another condition in your loop if(all.equal(x,y)=TRUE) i=i+1 else t.test... something in that direction. best, daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: r-help-boun...@r-project.org [mailto:r-help-boun...@

Re: [R] Population pyramids

2009-07-09 Thread Daniel Malter
Victor, use the axes=FALSE option, as you do. Then use the "labels" and "at" options in the "axis" argument to place the tickmark labels in the negative plot manually par(mfrow=c(1,2),bty="n",mai=c(0.5, 0.25, 0.25, 0.25)) x=rgamma(1000,10,0.3) barplot(height=t(-x), width = 0.825, space = NULL,

[R] correct way to subset a vector

2009-07-09 Thread Juliet Hannah
Hi, #make example data dat <- data.frame(matrix(rnorm(15),ncol=5)) colnames(dat) <- c("ab","cd","ef","gh","ij") If I want to get a subset of the data for the middle 3 columns, and I know the names of the start column and the end column, I can do this: mysub <- subset(dat,select=c(cd:gh)) If I w

[R] How to: initialize, setValidity, copy-constructor

2009-07-09 Thread Renaud Gaujoux
Hello list, I'm having troubles setting up a basic calss hierarchy with S4. Here is a simplified schema of what I'd like to do: - Two classes: A and B that extends A - Ensure that the slots added by B are consistent with the slots of A - Let A initialize itself (I'm not supposed to know the inte

Re: [R] treating a data symbol like a character

2009-07-09 Thread Andrew Yee
Great, that's a good starting point. Andrew On Thu, Jul 9, 2009 at 11:20 AM, Jorge Ivan Velez wrote: > > Hi Andrew, > If I understand correctly, then > > # Data > x <- c(3,4,2) > > # Collection of text and symbols > Text <- c('foo', 'abcd', 'John') > PCH <- c('+','O','$') > > # Plotting > plot(x,

Re: [R] treating a data symbol like a character

2009-07-09 Thread Jorge Ivan Velez
Hi Andrew, If I understand correctly, then # Data x <- c(3,4,2) # Collection of text and symbols Text <- c('foo', 'abcd', 'John') PCH <- c('+','O','$') # Plotting plot(x, pch = PCH) legend('topright', pch = PCH, Text, ncol = 3) should be close to what you want. Note that the text() / points() c

Re: [R] treating a data symbol like a character

2009-07-09 Thread Andrew Yee
Thanks for your help. I should have been more clear in my initial e-mail. I shouldn't have used 'alpha' or 'beta,' to avoid confusion with them as Greek symbols. I should have stated something like: O foo O abcd O John While I'm familiar with using legend to make the filled boxes, I'm intereste

[R] plm Issues

2009-07-09 Thread Damien Moore
Hi List I'm having difficulty understanding how plm should work with dynamic formulas. See the commands and output below on a standard data set. Notice that the first summary(plm(...)) call returns the same result as the second (it shouldn't if it actually uses the lagged variable requested). The

Re: [R] treating a data symbol like a character

2009-07-09 Thread Jorge Ivan Velez
Hi Andrew, Do you want to put the symbols you described as a legend in a plot? If so, here is one way: x <- rnorm(3) plot(x, pch = 16, cex = 1.1, col = 1:3) legend('topleft', ncol = 3, c(expression(alpha), expression(beta), expression(gamma)), pch = 16, cex = 1.1, col = 1:3) Is you do no

[R] treating a data symbol like a character

2009-07-09 Thread Andrew Yee
Hi, is there a way to treat a data symbol, e.g. one with pch = 16, as a character? Specifically, I'm interested in creating a line of text as follows using the text() function O alpha O beta O gamma where the "O" is pch 16 and filled with a specific color. Not sure if this is possible or not. T

[R] naming of columns in R dataframe consisting of mixed data (alphanumeric and numeric)

2009-07-09 Thread Mary A. Marion
Hello, I have an r function that creates the following dataframe tresults2. Notice that column 1 does not have a column heading. Tresults2: [,1] estparam 18.0 nullval 20.0 . . . ciWidth 2.04622 HalfInterval 1.02311 pertinent code: results<-cbind( estparam

Re: [R] RDCOMClient: how to close Excel process?

2009-07-09 Thread Lauri Nikkinen
This solution worked: nBooks <- xl[["Workbooks"]]$Count(); for (i in seq_len(nBooks)) xl[["Workbooks"]]$item(i)$Close(SaveChanges=FALSE); from http://www.mail-archive.com/r-help@r-project.org/msg61498.html Thanks! -L 2009/7/9 Lauri Nikkinen : > Thanks again. That did n

Re: [R] Dantzig Selector

2009-07-09 Thread roger koenker
There is an experimental version available here: http://www.econ.uiuc.edu/~roger/research/sparse/sfn.html that uses the interior point code in the package quantreg. There is an option to exploit possible sparsity of the X matrix. Comments would be welcome. url:www.econ.uiuc.edu/~

Re: [R] heatmap.2: question regarding the "raw z-score"

2009-07-09 Thread James W. MacDonald
Hi Chrysanthi, Chrysanthi A. wrote: Thanks a lot..! What exactly the sweep function is doing? Also, is there a possibility instead of using the mean of the whole row to get only the mean of a group of the row values? So the values in the matrix (heat map) used in the comparison are z-scores

  1   2   >