Re: [R] How to convert an ftable object to a matrix including the row names?

2011-05-26 Thread Marius Hofert
Dear Prof. Ripley, many thanks for your quick reply. A character matrix (although clearly not very elegant) would be no problem, xtable deals with that. I tried as.data.frame() before, but if one wants to have the same rows as in ft, one has to use additional commands (?): ft # => 16 rows as.

Re: [R] How to convert an ftable object to a matrix including the row names?

2011-05-26 Thread Prof Brian Ripley
as.data.frame(ft) seems straightforward enough. I don't think you actually want a matrix, as they would have to be a character matrix and the ftable object is numeric. On Fri, 27 May 2011, Marius Hofert wrote: Dear expeRts, What's the easiest way to convert an ftable object to a matrix suc

Re: [R] error message %1 is not a valid Win32 application.

2011-05-26 Thread Prof Brian Ripley
On Thu, 26 May 2011, Duncan Murdoch wrote: On 11-05-26 9:11 PM, sivan aldor wrote: I ran the exact command this morning on a friend's computer which is 32bit and it worked! I am now running it from a different computer. As far as I can tell the only difference is that his OS is VISTA and mine i

[R] How to convert an ftable object to a matrix including the row names?

2011-05-26 Thread Marius Hofert
Dear expeRts, What's the easiest way to convert an ftable object to a matrix such that the row names of the ftable object are shown in the first couple of columns of the matrix? This is (typically) required, for example, when the final goal is to print the matrix via xtable. Below is a rather

[R] System is computationally singular error for plm random effects models

2011-05-26 Thread Stanislav Chankov
Dear all, I am using the plm package for both fixed and random effects models on my country-year panel data. However, for some of the random effects models I get the following error: Error in solve.default(OM) : system is computationally singular: reciprocal condition number = 1.78233e-18 The

Re: [R] Latent class analysis, selection of the number of classes

2011-05-26 Thread Daniel Malter
Thanks everybody. -- View this message in context: http://r.789695.n4.nabble.com/Latent-class-analysis-selection-of-the-number-of-classes-tp3545538p3554357.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing li

Re: [R] error message %1 is not a valid Win32 application.

2011-05-26 Thread Duncan Murdoch
On 11-05-26 9:39 PM, sivan aldor wrote: The file was copied properly, My instinct is the problem has to do with the OS but I want to see if there is a way to resolve this. Sounds like you have to take it up with the OS manufacturer then. Duncan Murdoch On Thu, May 26, 2011 at 9:35 PM, Dunc

Re: [R] error message %1 is not a valid Win32 application.

2011-05-26 Thread sivan aldor
The file was copied properly, My instinct is the problem has to do with the OS but I want to see if there is a way to resolve this. On Thu, May 26, 2011 at 9:35 PM, Duncan Murdoch wrote: > On 11-05-26 9:11 PM, sivan aldor wrote: > >> I ran the exact command this morning on a friend's computer wh

Re: [R] error message %1 is not a valid Win32 application.

2011-05-26 Thread Duncan Murdoch
On 11-05-26 9:11 PM, sivan aldor wrote: I ran the exact command this morning on a friend's computer which is 32bit and it worked! I am now running it from a different computer. As far as I can tell the only difference is that his OS is VISTA and mine is Windows 7. Can that really be the problem?!

[R] Email spam from my account on May 26, 2011

2011-05-26 Thread Gregory Propf
I just discovered that some evil spammer has somehow gotten my contacts list and used it to send out a bunch of spam. This is just to notify you that if you get an email from me on May 26, 2011 (other than this one or one like it - the problem was more extensive than I first thought) it wasn'

Re: [R] error message %1 is not a valid Win32 application.

2011-05-26 Thread sivan aldor
I ran the exact command this morning on a friend's computer which is 32bit and it worked! I am now running it from a different computer. As far as I can tell the only difference is that his OS is VISTA and mine is Windows 7. Can that really be the problem?!?! On Thu, May 26, 2011 at 9:05 PM, Dunca

Re: [R] error message %1 is not a valid Win32 application.

2011-05-26 Thread Duncan Murdoch
On 11-05-26 8:42 PM, sivan aldor wrote: The only command I am using is dyn.load("dbsvls.dll") Okay, I get the error message you showed if I try to load something that really isn't a valid Win32 dll, and I don't get it when I load a valid one. (I'm not sure if I can fix it to replace the %1

Re: [R] predictive accuracy

2011-05-26 Thread Mike Marchywka
> Date: Thu, 26 May 2011 13:50:15 -0700 > From: gunter.ber...@gene.com > To: ahmed.el-taht...@pfizer.com > CC: r-help@r-project.org > Subject: Re: [R] predictive accuracy > > 1. This is not about R, and should be taken off list. Well, depending on wha

Re: [R] error message %1 is not a valid Win32 application.

2011-05-26 Thread sivan aldor
The only command I am using is dyn.load("dbsvls.dll") On Thu, May 26, 2011 at 8:41 PM, Duncan Murdoch wrote: > On 11-05-26 4:53 PM, sivan aldor wrote: > >> Hi Everyone, >> I am trying to work with a routine that is from the IMSL called BSVLS. I >> have the file as a .dll file. >> I have been tr

Re: [R] error message %1 is not a valid Win32 application.

2011-05-26 Thread Duncan Murdoch
On 11-05-26 4:53 PM, sivan aldor wrote: Hi Everyone, I am trying to work with a routine that is from the IMSL called BSVLS. I have the file as a .dll file. I have been trying to call the routine using the dyn.load function. I am working on a 32-bit windows 7 OS with 3 GB. For some reason i still

Re: [R] zoo column names

2011-05-26 Thread Pete Brecknock
Gabor Grothendieck wrote: > > On Thu, May 26, 2011 at 7:35 PM, Pete Brecknock > wrote: >> I have a zoo object that contains 2 time series named "A-B" and "V1". >> >> When I create a third series "V2", the name of the "A-B" series is >> changed >> to "A.B". >> >> Although

Re: [R] change function scope?

2011-05-26 Thread Duncan Murdoch
On 11-05-26 5:09 PM, James McCreight wrote: I'm still getting used to R's scoping. I've run into the following situation value=0 thefunction<- function() print( value ) somefunction<- function() { value=99; thefunction() } somefunction() now, I understand that somefunction() returns 0 because t

Re: [R] zoo column names

2011-05-26 Thread Gabor Grothendieck
On Thu, May 26, 2011 at 7:35 PM, Pete Brecknock wrote: > I have a zoo object that contains 2 time series named "A-B" and "V1". > > When I create a third series "V2", the name of the "A-B" series is changed > to "A.B". > > Although I could recreate the names for the 3 series I am wondering if there

Re: [R] 3 Y axis possible?

2011-05-26 Thread Walmes Zeviani
Jun, The par() command is to give extra margin on right side to accomodate the y axis label. I recognize, like Rolf, that three y axis can be cumbersome, confuse. So, I would adopt another approach using lattice::xyplot() require(reshape) x <- melt(x, id="Time") str(x) require(lattice) xyplot(va

Re: [R] change function scope?

2011-05-26 Thread Gabor Grothendieck
On Thu, May 26, 2011 at 5:09 PM, James McCreight wrote: > I'm still getting used to R's scoping. I've run into the following situation > > value=0 > thefunction <- function() print( value ) > somefunction <- function() { value=99; thefunction() } > somefunction() > > now, I understand that somefun

Re: [R] change function scope?

2011-05-26 Thread James McCreight
Thanks to Mark for an off-list suggestion which works. somefunction <- function() { value=99; environment(thefunction) <- environment(); thefunction() } this apparently defines a copy of thefunction within somefunction, exactly what I wanted. thefunction in the global env is unchanged. It seems

[R] zoo column names

2011-05-26 Thread Pete Brecknock
I have a zoo object that contains 2 time series named "A-B" and "V1". When I create a third series "V2", the name of the "A-B" series is changed to "A.B". Although I could recreate the names for the 3 series I am wondering if there is a way of preventing the name change from happening ( ... may

Re: [R] Applying "toupper" to only portions of text strings

2011-05-26 Thread Gabor Grothendieck
On Thu, May 26, 2011 at 6:05 PM, Dennis Fisher wrote: > Colleagues > > Assume that I have a vector containing some text strings, some of which > contain a particular character.  I could like to apply "toupper" to the text > before the character.  For example (in this case, "|" is the particular

Re: [R] summing array elements

2011-05-26 Thread Erich Neuwirth
> arr<-1:72 > dim(arr)<-c(2,4,3,3) > apply(arr,1:2,sum) [,1] [,2] [,3] [,4] [1,] 297 315 333 351 [2,] 306 324 342 360 > apply(arr,3:4,sum) [,1] [,2] [,3] [1,] 36 228 420 [2,] 100 292 484 [3,] 164 356 548 > apply(arr,1:2,sum) will sum all elements arr(i1,i2,..) for each

Re: [R] NaN, Inf to NA

2011-05-26 Thread William Dunlap
I think the source of the OP's problem is that while things like df>30 and is.na(df) return a logical matrix with the dimensions of the data.frame df, both is.infinite(df) and is.nan(df) return a logical vector as long as the number of columns of df. (`>` and is.na have data.frame methods but is.i

Re: [R] summing array elements

2011-05-26 Thread Thomas Lumley
On Fri, May 27, 2011 at 10:06 AM, marco milella wrote: > Hi to everybody > I have an array with dimensions 2,4,3,3. > Wanting to sum the matrices in the first two dimensions, I'm trying to use > the "apply" function, but with no results. Have to say I'm quite new with R > syntax. Tell apply() whi

[R] summing array elements

2011-05-26 Thread marco milella
Hi to everybody I have an array with dimensions 2,4,3,3. Wanting to sum the matrices in the first two dimensions, I'm trying to use the "apply" function, but with no results. Have to say I'm quite new with R syntax. tx in advance marco [[alternative HTML version deleted]] ___

[R] time series comparison

2011-05-26 Thread joseph
Hi I have 2 time series consisting of sequence of data points measuring flies activity at time intervals of 20 min over a period of 24 hrs. One time series is from control flies while the other is from flies treated with a drug. My question is to find out if the drug has a significant effect

Re: [R] Applying "toupper" to only portions of text strings

2011-05-26 Thread Phil Spector
Dennis - Here's one way, using a somewhat obscure feature of perl regular expressions, i.e. the \U and \L escape characters which modify the case of the strings they appear in: TEXT<- c("", "bbb|cc", "|ddd") sub('([a-z]*)(\\|?)([a-z]*)','\\U\\1\\2\\L\\3',TEXT,perl=TRUE) [1] ""

Re: [R] Question about ggplot2

2011-05-26 Thread Hadley Wickham
> If a function uses substitute() or its equivalent to avoid evaluating > its arguments in the normal way, you are pretty much forced to use > eval() with the output of substitute() or call() or use do.call() > to evaluate the arguments it will not evaluate for itself. Which is why I'd argue all f

Re: [R] Applying "toupper" to only portions of text strings

2011-05-26 Thread peter dalgaard
On May 27, 2011, at 00:05 , Dennis Fisher wrote: > Colleagues > > Assume that I have a vector containing some text strings, some of which > contain a particular character. I could like to apply "toupper" to the text > before the character. For example (in this case, "|" is the particular >

Re: [R] JGR/Deducer Installation

2011-05-26 Thread Ista Zahn
Hi Vikas, I've found it nessessary to do su R CMD javareconf After java updates. Then install/update JGR etc. if desired. Note that for whatever reason 'sudo R CMD javareconf' doesn't seem to work for me, I have to actually become root with su and then run R CMD javareconf Best, Ista On Thu, M

Re: [R] Question about ggplot2

2011-05-26 Thread William Dunlap
> -Original Message- > From: Brian Diggs [mailto:dig...@ohsu.edu] > Sent: Thursday, May 26, 2011 2:59 PM > To: William Dunlap > Cc: Julian TszKin Chan; r-help@r-project.org > Subject: Re: Question about ggplot2 > > On 5/26/2011 2:15 PM, William Dunlap wrote: > > eval(substitute( > > >

Re: [R] Applying "toupper" to only portions of text strings

2011-05-26 Thread Bert Gunter
Cute! I don't think your proposed strategy is all that complicated, but see the gsubfn package for a one-liner. In particular, check out http://code.google.com/p/gsubfn/ where there is an example for your almost exact task. -- Bert On Thu, May 26, 2011 at 3:05 PM, Dennis Fisher wrote: > Collea

Re: [R] Custom CDF Entrez ID for MacOS

2011-05-26 Thread Martin Morgan
On 05/26/2011 01:32 PM, Petter Brodin wrote: Dear all Does anybody know of updated Custom CDFs with binaries for MacOS. I'm trying to do affy-analysis using R-studio for Mac. Hi Petter -- ask on the Bioconductor mailing list http://bioconductor.org/help/mailing-list Generally, CDF files do n

[R] Applying "toupper" to only portions of text strings

2011-05-26 Thread Dennis Fisher
Colleagues Assume that I have a vector containing some text strings, some of which contain a particular character. I could like to apply "toupper" to the text before the character. For example (in this case, "|" is the particular character): ORIGINAL: TEXT<- c("", "bbb|cc", "|

Re: [R] 3 Y axis possible?

2011-05-26 Thread Rolf Turner
On 27/05/11 03:35, Jun Shen wrote: Dear list, We have three time course profiles with very different scales, and we want to show them in one plot. Is it possible to have three y axis? I guess not, then what would be other options? something like two 2-y axis plots on a three dimensional view? Ap

Re: [R] R-Size Limit (Confused)

2011-05-26 Thread David Winsemius
On May 26, 2011, at 5:15 PM, Struckmeier, Nathanael wrote: Hello, I've been banging my head against my monitor for some time now trying to import data into R. The problem is either in my use of syntax, my data format, or my memory. I have described what I have tried below. Please help. ===

Re: [R] Question about ggplot2

2011-05-26 Thread Brian Diggs
On 5/26/2011 2:15 PM, William Dunlap wrote: eval(substitute( qplot(x=xVariable,y=yVariable,data=diamonds,geom=c('point','smooth')), list(xVariable=as.name("carat"), yVariable=as.name("price")) )) Well, yes, I suppose there is that. I've mentally (perhaps inappropriately) lumped substitu

[R] error message %1 is not a valid Win32 application.

2011-05-26 Thread sivan aldor
Hi Everyone, I am trying to work with a routine that is from the IMSL called BSVLS. I have the file as a .dll file. I have been trying to call the routine using the dyn.load function. I am working on a 32-bit windows 7 OS with 3 GB. For some reason i still keep getting the error message LoadLibra

[R] Custom CDF Entrez ID for MacOS

2011-05-26 Thread Petter Brodin
Dear all Does anybody know of updated Custom CDFs with binaries for MacOS. I'm trying to do affy-analysis using R-studio for Mac. Thanks Petter __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the pos

Re: [R] Different behavior of median and mean function - Why?

2011-05-26 Thread Christoph Jäckel
Hey together, thanks a lot for the quick and helpful answers. I will not use median on a data.frame from now on and use sapply instead. Thanks Christoph On Thu, May 26, 2011 at 11:37 PM, Marc Schwartz wrote: > On May 26, 2011, at 4:22 PM, Christoph Jäckel wrote: > >> Hi together, >> >> below is

Re: [R] Different behavior of median and mean function - Why?

2011-05-26 Thread Marc Schwartz
On May 26, 2011, at 4:22 PM, Christoph Jäckel wrote: > Hi together, > > below is a small example which produces outcome I do not understand, > namely that the median function works fine on a data.frame without > negative numbers, but doesn't work on a data.frame with one negative > number. I'm su

Re: [R] Different behavior of median and mean function - Why?

2011-05-26 Thread Joshua Wiley
Hi Christoph, Use: sapply(df, median) median() does not have methods for a data frame (read: it is never meant to be used directly on data frames so do not expect sensical results). Cheers, Josh On Thu, May 26, 2011 at 2:22 PM, Christoph Jäckel wrote: > Hi together, > > below is a small exam

Re: [R] Different behavior of median and mean function - Why?

2011-05-26 Thread Sarah Goslee
Christoph, After a quick look at the code for median, I'm amazed that it gives a correct result for any data frame. median() isn't really intended for use with data frames; there's no data.frame method. The correct and safe approach is to use sapply(df, median) This was recently discussed on the

Re: [R] Different behavior of median and mean function - Why?

2011-05-26 Thread Mitchell Maltenfort
Summary (df) will also work. On 5/26/11, Christoph Jäckel wrote: > Hi together, > > below is a small example which produces outcome I do not understand, > namely that the median function works fine on a data.frame without > negative numbers, but doesn't work on a data.frame with one negative > nu

[R] Different behavior of median and mean function - Why?

2011-05-26 Thread Christoph Jäckel
Hi together, below is a small example which produces outcome I do not understand, namely that the median function works fine on a data.frame without negative numbers, but doesn't work on a data.frame with one negative number. I'm sure there is a reasonable explanation for that or better, that I'm

[R] R-Size Limit (Confused)

2011-05-26 Thread Struckmeier, Nathanael
Hello, I've been banging my head against my monitor for some time now trying to import data into R. The problem is either in my use of syntax, my data format, or my memory. I have described what I have tried below. Please help. =My GOAL== >import a 4 c

Re: [R] anyone using LARS package in R

2011-05-26 Thread Clemontina Alexander
I have used lars before. I could not find a tutorial, so finally asked a professor at my school. He has a wrapper that nicely prints out all the variables that were selected and is more stable in cross validation than the original package. See below for the code and description. http://www4.stat.n

Re: [R] NaN, Inf to NA

2011-05-26 Thread Marc Schwartz
On May 26, 2011, at 3:18 PM, Albert-Jan Roskam wrote: > Hi, > > I want to recode all Inf and NaN values to NA, but I;m surprised to see the > result of the following code. Could anybody enlighten me about this? > >> df <- data.frame(a=c(NA, NaN, Inf, 1:3)) >> df[is.infinite(df) | is.nan(df)] <

Re: [R] Question about ggplot2

2011-05-26 Thread William Dunlap
eval(substitute( qplot(x=xVariable,y=yVariable,data=diamonds,geom=c('point','smooth')), list(xVariable=as.name("carat"), yVariable=as.name("price")) )) Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-

[R] change function scope?

2011-05-26 Thread James McCreight
I'm still getting used to R's scoping. I've run into the following situation value=0 thefunction <- function() print( value ) somefunction <- function() { value=99; thefunction() } somefunction() now, I understand that somefunction() returns 0 because thefunction() was defined with value=0 in its

Re: [R] Question about ggplot2

2011-05-26 Thread Brian Diggs
On 5/26/2011 12:29 PM, Julian TszKin Chan wrote: Hi all, Is there any way for me to to string in the argument of qplot or ggplot? for example qplot(x='carat',y='price',data=diamonds,geom=c('point','smooth')) instead of qplot(x=carat,y=price,data=diamonds,geom=c('point','smooth')) I don't know

Re: [R] 3 Y axis possible?

2011-05-26 Thread Walmes Zeviani
You can pass a vector of ticks to the axis() function that expand the actual range, par(mar=c(5.1,4.1,4.1,5.1)) plot(x$Time, x$y1, type='l', bty = 'c', col = 'red') par(new = TRUE) plot(x$Time, x$y2, type = 'l', axes = FALSE, xlab = '', ylab = '', col= 'green') ##axis(4, col='green') axis(4, at=se

Re: [R] predictive accuracy

2011-05-26 Thread Bert Gunter
1. This is not about R, and should be taken off list. 2. You are wading in an alligator infested swamp. Get help from (other) statisticians at Pfizer (there are many good ones there). Best, Bert P.S. The answer to all your questions is "no" (imho). On Thu, May 26, 2011 at 1:35 PM, El-Tahtawy,

Re: [R] predictive accuracy

2011-05-26 Thread El-Tahtawy, Ahmed
The strong predictor is the country/region where the study was conducted. So it is not important/useful for a clinician to use it (as long he/she is in USA or Europe). Excluding that predictor will make another 2 insignificant predictors to become significant!! Can the new model have a reliable

[R] confidence interval on mean in log-regression

2011-05-26 Thread Alice Shelly
Hello- I am looking for R function that will give me some proper confidence intervals on un-transformed mean prediction when performing a linear regression on log-transformed data. I am referring to the UMVU estimate, the el-shaarawi and viveros (1997) estimate, or the Wu, wong, and Wei (2005) est

Re: [R] Suppress intermediate results on console

2011-05-26 Thread Lisa
Thanks for your comments and suggestion. I didn’t show all my own function here because it has many lines. “x” is the results of another function. I am calling summary because I want to extract some values from the results. -- View this message in context: http://r.789695.n4.nabble.com/Suppress-

Re: [R] 3 Y axis possible?

2011-05-26 Thread Jun Shen
Thanks a bunch, Walmes. One more concern, the new Y axes added do not extend all the way down to cross with x axis. Is there anyway to make them look like the very first Y axis on the left? Jun On Thu, May 26, 2011 at 1:24 PM, Walmes Zeviani wrote: > You can use mtext() > > par(mar=c(5.1,4.1,4.

Re: [R] NaN, Inf to NA

2011-05-26 Thread Ian Gow
> df$a[is.infinite(df$a) | is.nan(df$a) ] <- NA > df a 1 NA 2 NA 3 NA 4 1 5 2 6 3 On 5/26/11 3:18 PM, "Albert-Jan Roskam" wrote: >Hi, > >I want to recode all Inf and NaN values to NA, but I;m surprised to see >the >result of the following code. Could anybody enlighten me about this? > >>

Re: [R] What are the common Standard Statistical methods used for the analysis of a dataset

2011-05-26 Thread Greg Snow
I think the IOTT is more a general testing framework rather than a single test (like maximum likelihood, least squares, bootstrap, etc.) so a single function won't capture the whole IOTT. There are already many functions available to do IOTT for many cases (well the user needs to provide the oc

[R] NaN, Inf to NA

2011-05-26 Thread Albert-Jan Roskam
Hi, I want to recode all Inf and NaN values to NA, but I;m surprised to see the result of the following code. Could anybody enlighten me about this? > df <- data.frame(a=c(NA, NaN, Inf, 1:3)) > df[is.infinite(df) | is.nan(df)] <- NA > df a 1 NA 2 NaN 3 Inf 4 1 5 2 6 3 > Thanks!

Re: [R] matrix not working

2011-05-26 Thread Bert Gunter
Please... ?"[" Online tutorial "An Introduction to R." I think you'll find everything you need in these. -- Bert On Thu, May 26, 2011 at 12:39 PM, Dat Mai wrote: > When I use the as.matrix, the data.frame does turn into a matrix, but I > cannot change the dimensions of the matrix. I'd still

Re: [R] matrix not working

2011-05-26 Thread Dat Mai
When I use the as.matrix, the data.frame does turn into a matrix, but I cannot change the dimensions of the matrix. I'd still want it to have that pseudo cartesian format (e.g. [a1,b1], [a2,b2]) On Thu, May 26, 2011 at 6:58 PM, David Winsemius wrote: > > On May 26, 2011, at 1:53 PM, Andy Zhu wrot

Re: [R] R import glitch "missing data"

2011-05-26 Thread StatBat2
Wierd... sorry about the double posting... -- View this message in context: http://r.789695.n4.nabble.com/R-import-glitch-missing-data-tp3553079p3553444.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

[R] Question about ggplot2

2011-05-26 Thread Julian TszKin Chan
Hi all, Is there any way for me to to string in the argument of qplot or ggplot? for example qplot(x='carat',y='price',data=diamonds,geom=c('point','smooth')) instead of qplot(x=carat,y=price,data=diamonds,geom=c('point','smooth')) Thanks!! Regards, TszKin Julian [[alternative HTML ve

Re: [R] text mining

2011-05-26 Thread Matevž Pavlič
HI, I do it like this : setwd("C:/Users/mpavlic/Desktop/Temp") library(tm) tekst <- Corpus(DirSource("."),readerControl = list(language ="ansi")) where *.txt files are stored in a folder Temp in my desktop, HTH, m -Original Message- From: r-help-boun...@r-project.org [mailto:r-hel

Re: [R] Suppress intermediate results on console

2011-05-26 Thread Jonathan Daily
Well, since we have no idea what x is, that is going to be hard to do. Are you calling summary because you want the info on the last iteration of a loop? If so, just put the summary call outside the loop. Otherwise, why are you calling summary if you don't want a summary? Also, the posting guide r

Re: [R] matrix not working

2011-05-26 Thread David Winsemius
On May 26, 2011, at 1:53 PM, Andy Zhu wrote: Dat: 1. you can use as.matrix to convert data.frame to matrix; 2. it is likely that the internal representation of your data.frame may not be numerical value; matrix can only take on numeric. Not true. Can be any single mode, including "charac

Re: [R] Count of rows while looping through data

2011-05-26 Thread Jeanna
Thank you both. These solutions are far more elegant than anything I could have come up with, and I appreciate the opportunity to learn new commands within the context of my own data. I think I've got it working now. :) -- View this message in context: http://r.789695.n4.nabble.com/Count-of-r

Re: [R] Compiling Rgraphiz on Windows 7 64bit with R-2.13.0

2011-05-26 Thread jirivoller
Duncan, installing MikTeX solved the problem. thank you. -- View this message in context: http://r.789695.n4.nabble.com/Compiling-Rgraphiz-on-Windows-7-64bit-with-R-2-13-0-tp3493750p3553281.html Sent from the R help mailing list archive at Nabble.com.

[R] Suppress intermediate results on console

2011-05-26 Thread Lisa
Dear all, I have a question about how to suppress intermediate results in a function on console. For example, I will use summary() in my own function that looks like: myfunction <- function(…) { … Summary(x) … } Then myfunction() will print “x” on console that is intermediate result and do

[R] Survival: pyears and ratetable: expected events

2011-05-26 Thread Jim Trabas
Dear all, I am having a (really) hard time getting pyears to work together with a ratetable to give me the number of expected events (deaths). I have the following data: dos, date of surgery, as.Date dof, date of last follow-up, as.Date dos, date of surgery, as.Date sex, gender, as.factor (femal

Re: [R] matrix not working

2011-05-26 Thread Andy Zhu
Dat: 1. you can use as.matrix to convert data.frame to matrix; 2. it is likely that the internal representation of your data.frame may not be numerical value; matrix can only take on numeric. --- On Thu, 5/26/11, Dat Mai wrote: From: Dat Mai Subject: [R] matrix not working To: r-help@r-pro

Re: [R] Thiessen Method

2011-05-26 Thread Thomas Adams
Federico, I understand what you are after — you want time-series estimates based on the Thiessen polygon estimates taken from the station time-series data. My recommendation is that the process of doing this would be far easier using something like GRASS GIS, possibly in conjunction with R (s

Re: [R] 3 Y axis possible?

2011-05-26 Thread David Winsemius
On May 26, 2011, at 2:18 PM, Jun Shen wrote: > David, > > I surely tried the labels argument. But it seems for tick marks not > for a text label. Did you see a different outcome? Thanks. > `labels` is for labels, `at` is for tick (and label) locations. They should be the same length. One lab

Re: [R] 3 Y axis possible?

2011-05-26 Thread Walmes Zeviani
You can use mtext() par(mar=c(5.1,4.1,4.1,5.1)) plot(x$Time, x$y1, type='l', bty = 'c', col = 'red') par(new = TRUE) plot(x$Time, x$y2, type = 'l', axes = FALSE, xlab = '', ylab = '', col= 'green') axis(4, col='green') mtext(side=4, text="label green", line=2) par(new = TRUE) plot(x$Time, x$y3, ty

Re: [R] 3 Y axis possible?

2011-05-26 Thread Jun Shen
David, I surely tried the labels argument. But it seems for tick marks not for a text label. Did you see a different outcome? Thanks. Jun On Thu, May 26, 2011 at 12:38 PM, David Winsemius wrote: > > On May 26, 2011, at 1:25 PM, Jun Shen wrote: > > Jim, >> >> One more question, how do I put a l

Re: [R] Thiessen Method

2011-05-26 Thread Sarah Goslee
Federico, That's an improvement, but a long way from the reproducible example requested by the posting guide. I and others who might help are more interested in the way the data and coordinates are organized and a detailed explanation of what you expect the results to look like, etc, than in a ver

[R] 'constrained' negative.binomial model estimates

2011-05-26 Thread Carson Farmer
Hello list, I am not sure if the terminology that I am using here is widely used, however, I provide an example in the hopes that my problem will become clear. My basic problem is that I am unsure of how to 'constrain' my model estimates to reproduce the aggregate (by factor levels) observed depen

Re: [R] R import glitch "missing data"

2011-05-26 Thread StatBat2
That is the strange thing... I DON’T get a warning message. R behaves as if all data is being imported successfully. I don't receive a memory warning, or warning of any kind. I've scanned my data for potential problems and I do not have any ('). However... The .txt version of my file does use (")

Re: [R] R import glitch "missing data"

2011-05-26 Thread Struckmeier, Nathanael
That is the strange thing... I DON'T get a warning message. R behaves as if all data is being imported successfully. I don't receive a memory warning, or warning of any kind. I've scanned my data for potential problems and I do not have any ('). However... The .txt version of my file does use (")

Re: [R] R import glitch "missing data"

2011-05-26 Thread David Winsemius
On May 26, 2011, at 1:59 PM, Peter Langfelder wrote: On Thu, May 26, 2011 at 10:03 AM, StatBat2 wrote: Hello! I am trying import data into R and im running into a snag. GOAL: Import a 4 column, 8,000 row table into R including headers. WHAT I'VE ATTEMPTED: Original data was in Excel format

Re: [R] matching by gender and age

2011-05-26 Thread David Winsemius
On May 26, 2011, at 11:19 AM, 1Rnwb wrote: Hello R gurus, I have a data set from which i have to extract the gender and age matched rows from controls and disease group You need to define what you mean by "age-matched". Your example creates a very narrow age range which further adds quest

Re: [R] R import glitch "missing data"

2011-05-26 Thread Peter Langfelder
On Thu, May 26, 2011 at 10:03 AM, StatBat2 wrote: > Hello! > > I am trying import data into R and im running into a snag. > > GOAL: > Import a 4 column, 8,000 row table into R including headers. > > WHAT I'VE ATTEMPTED: > Original data was in Excel format. > Converted data to both a .txt and .csv

[R] interpolation and extremum location of a surface

2011-05-26 Thread Clement LAUZIN
Hello, I have a x,y,z file. Z is not corresponding to a simple analytical function of x and y. I am trying to find the minimum value of z by a spline interpolation or from a polynomial fit. I tried the akima package but as the location of the point I am looking for (the minimum) is outside of t

Re: [R] Thiessen Method

2011-05-26 Thread federico.eccel
Dear Sarah, I have a grid in which 8 raingauges are locted, in my case the dataset is composed by 8 hourly timeseries, one for each raingauge. I would like to obtain from these timeseries using the Thiessen method the values of the precipitation in all the grid. In particular I would like to creat

[R] matching by gender and age

2011-05-26 Thread 1Rnwb
Hello R gurus, I have a data set from which i have to extract the gender and age matched rows from controls and disease group disease<-paste(rep(c('y','n'),11)) gender<-paste(rep(c('m','f'),11)) mcp<-rnorm(700,1400) age<-rnorm(32,34) dat<-data.frame(disease=disease,sex=gender,Dr_age=age[1:22],MCP=

[R] bringing worldclim data into R

2011-05-26 Thread Lori12
Hi, I'm going to try to do some species distribution modeling in R using Mahalanobis distance. I have presence point locations for the species and I have ASCII files for each of the WorldClim variables for North America. My question is how do I bring these into R? If this is too complex, I have don

[R] R import glitch "missing data"

2011-05-26 Thread StatBat2
Hello! I am trying import data into R and im running into a snag. GOAL: Import a 4 column, 8,000 row table into R including headers. WHAT I'VE ATTEMPTED: Original data was in Excel format. Converted data to both a .txt and .csv (to see which worked better) Imported data into R via commands as o

Re: [R] 3 Y axis possible?

2011-05-26 Thread David Winsemius
On May 26, 2011, at 1:25 PM, Jun Shen wrote: Jim, One more question, how do I put a label on the axes I added? Thanks. I don't see any argument in axis() for that? Thanks You don't see the `labels` argument in the help page for `axis`? Jun David Winsemius, MD West Hartford, CT

Re: [R] 3 Y axis possible?

2011-05-26 Thread Jun Shen
Jim, One more question, how do I put a label on the axes I added? Thanks. I don't see any argument in axis() for that? Thanks Jun On Thu, May 26, 2011 at 11:20 AM, jim holtman wrote: > Try this: > > plot(x$Time, x$y1, type='l', bty = 'c', col = 'red') > par(new = TRUE) > plot(x$Time, x$y2, typ

Re: [R] 3 Y axis possible?

2011-05-26 Thread Jun Shen
I just found out by setting bty='l' to get rid of the border line on the top. On Thu, May 26, 2011 at 11:41 AM, Jun Shen wrote: > Hi, jim > > That's exactly what I wanted. One more trivial thing. How do I get rid the > border line on the top? Thanks again. > > Jun > > > On Thu, May 26, 2011 at 1

Re: [R] Time and db precision

2011-05-26 Thread Marc Schwartz
On May 26, 2011, at 10:04 AM, Mikkel Grum wrote: > Thanks Marc, > > I had just come up with another, slightly more convoluted solution. Add as.is > = TRUE to the query and then get the timetoken with > timetoken <- df$timestamp[df$timestamp == max(as.POSIX(df$timestamp))] > > While it looks li

Re: [R] 3 Y axis possible?

2011-05-26 Thread Jun Shen
Hi, jim That's exactly what I wanted. One more trivial thing. How do I get rid the border line on the top? Thanks again. Jun On Thu, May 26, 2011 at 11:20 AM, jim holtman wrote: > Try this: > > plot(x$Time, x$y1, type='l', bty = 'c', col = 'red') > par(new = TRUE) > plot(x$Time, x$y2, type = '

[R] matrix not working

2011-05-26 Thread Dat Mai
Hello All, I'm trying to create a matrix from a dataframe (let's call it df): ..a..b.c.d a inputs output b inputs output c inputs output d inputs output e inputs output The inputs are represented by columns a and b The outputs are represented by

Re: [R] 3 Y axis possible?

2011-05-26 Thread jim holtman
Try this: plot(x$Time, x$y1, type='l', bty = 'c', col = 'red') par(new = TRUE) plot(x$Time, x$y2, type = 'l', axes = FALSE, xlab = '', ylab = '', col = 'green') axis(4, col='green') par(new = TRUE) plot(x$Time, x$y3, type = 'l', axes = FALSE, xlab = '', ylab = '', col = 'blue') axis(4, col='blue',

Re: [R] 3 Y axis possible?

2011-05-26 Thread Jun Shen
Hi, Jim, Thanks for the information. But I am still not clear how to show the 3 separated Y axis. If I just call par(new=TRUE), the three axes are overlapped. attached some test data. Thanks. Jun = structure(list(Time = 1:1

Re: [R] Using read.xls

2011-05-26 Thread Marc Schwartz
On May 26, 2011, at 10:16 AM, Gabor Grothendieck wrote: > On Thu, May 26, 2011 at 11:09 AM, Marc Schwartz wrote: >> >> On May 26, 2011, at 5:09 AM, vioravis wrote: >> >>> I am using read.xls command from the gdata package. I get the following >>> error >>> when I try to read a work sheet from

Re: [R] 3 Y axis possible?

2011-05-26 Thread jim holtman
There is nothing to prevent you from putting 3 y-axis on your plot; might be confusing, but it can be done. What have you tried and why do you say "guess not"? With the use of par(new=TRUE) or by doing your own scaling, you can use 'axis' to put as many axises as you want on your graph. On Thu,

  1   2   >