[R] plotting time series using ggplots

2010-09-15 Thread Alison Macalady
Hi, I would like to plot a bunch of tree ring width data (time series) using ggplots, but I'm having trouble figuring out how to do it. My data is in a data.frame, with years as rownames and a distinct tree ring series in each column. So, something like this: rwl<-matrix(rnorm(800), nrow =

[R] Pesky homemade function code

2010-09-15 Thread trekvana
Hi all- this seems to be simple to figure out but since im new to writing functions I dont know what is happening. Here is my code along with the error I am receiving: semivario=function(data,ids,times,resids){ id=unique(data$ids) index=combinations(length(data$times[data$ids==id[1]]),2) time=ga

Re: [R] Object oriented programming in R.

2010-09-15 Thread Yvonnick Noel
I think you should have a look at the 'proto' package on CRAN. Yvonnick Noel University of Brittany, Rennes France __ 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.or

Re: [R] Get File Names in Folder, Read Files, Update, and Write

2010-09-15 Thread steven mosher
you are welcomed. Steve On Wed, Sep 15, 2010 at 6:11 PM, Suphajak Ngamlak < supha...@phatrasecurities.com> wrote: > Thank you so much. It works well > > > > Best Regards, > > Suphajak Ngamlak > Equity and Derivatives Trading > Phatra Securities Public Company Limited > Tel: +662-305-9179 > Emai

Re: [R] approxfun returning value higher than I would expect

2010-09-15 Thread stephen sefick
I will get R-dev tomorrow, and give it a try. Where do I check out the svn? thanks, Stephen On Wed, Sep 15, 2010 at 10:00 PM, Duncan Murdoch wrote: > I think this is fixed now.  There were actually two bugs: > > I fixed an old one a few days ago, but my fix didn't handle the case of > unsorted

Re: [R] Asking Favor

2010-09-15 Thread Michael Bedward
Hello Chuan, If you just want a matrix with the numbers 1 to 64 arranged by row... m <- matrix(1:64, ncol=8, byrow=TRUE) But perhaps I don't understand your question properly ? Michael On 16 September 2010 12:46, chuan zun liang wrote: > Dear Prof: > > My name is Chuan.I from Malaysia.I am a

[R] Asking Favor

2010-09-15 Thread chuan zun liang
Dear Prof: My name is Chuan.I from Malaysia.I am a beginner for R.I need favor for Prof. This is my data: y<-c(52,55,61,66,70,61,64,73,63,59,55,90,109,85,69,72,62,59,68,113,144,104,66,73,63,58,71,122,154,106,70,69,67,61,68,104,126,88,68,70,79,65,60,70,77,68,58,75,85,71,64,59,55,61,65,83,87,79,69,

[R] finding complex roots in R

2010-09-15 Thread Toros Caglar
I am looking for a way to find the roots of a non-polynomial expression. I know R has a few ways to deal with polynomials, but, I could not find a method that deals with functions involving e^(x) type arguments, that have complex roots as well as real roots. Any ideas? Thanks, Toros ___

Re: [R] ggplot bar geom: control the filling in the colour legend

2010-09-15 Thread Paul Murrell
Hi On 13/09/2010 8:03 p.m., Benoit Boulinguiez wrote: Hi all, I'm still seeking for tweaking the appearance of the "color" legend in a bar goemetry with ggplot2. I can't seem to control the filling of the colour legend squares take this, ggplot(diamonds, aes(clarity, fill=color,colour = cut)) +

Re: [R] use same breaks and colors, but the displayed scale are different-image.plot()

2010-09-15 Thread Dennis Murphy
Hi Jane, Try this: split.screen( rbind(c(0, .8,0,1), c(.8,1,0,1))) # [1] 1 2 # first screen split into a (2, 1) configuration ind <- split.screen(c(2,1), screen=1) screen(ind[1]) image(x, y, z, col = cols, zlim = zr) screen(ind[2]) image(x, y, z2, col = cols, zlim = zr) # Place the common, comple

Re: [R] approxfun returning value higher than I would expect

2010-09-15 Thread Duncan Murdoch
I think this is fixed now. There were actually two bugs: I fixed an old one a few days ago, but my fix didn't handle the case of unsorted x properly. (I haven't checked whether the old code handled that properly; I'd guess not, but it might have.) Now I've fixed my new bug. *Please* test

[R] use same breaks and colors, but the displayed scale are different-image.plot()

2010-09-15 Thread rusers.sh
Hi all, I want to put several figures in a one figure for easy comparison, so i need to use the same methods to plot these figures. The following is an example. I also list my method, but it does not work. #Example data x<- 1:10; y<- 1:10; z<- outer( x,y,"+");z2<- outer( x,y,"-") #Quick view them

Re: [R] Sweave and graphs

2010-09-15 Thread Katie Surrence
Thanks for your help! My computer died, and I set up Sweave on another computer, on which it is working perfectly. So perhaps I'll never be sure what the problem was on the other machine. On Tue, Sep 14, 2010 at 12:39 PM, Duncan Murdoch wrote: > On 14/09/2010 1:18 PM, Katie Surrence wrote: > >

Re: [R] standard error of difference for mixed effects

2010-09-15 Thread Dennis Murphy
Hi: Why is phase nested within sites? Shouldn't sites and phase be crossed? After all, there is one intervention (works) that purportedly affects the river both upstream and downstream. Moreover, why is log(flow) being treated as both a fixed and random effect? Just curious, Dennis On Wed, Sep 1

Re: [R] Inconvenient behavior of as.data.frame() for lists without names

2010-09-15 Thread David Winsemius
On Sep 15, 2010, at 6:10 PM, Magnus Thor Torfason wrote: Hi all, I ran into a small issue when converting a list of vectors to a data frame. The Issue I'm having is described by the snippet below: # # Convert a list of vectors into a

[R] standard error of difference for mixed effects

2010-09-15 Thread Meissner, Tony (DFW)
I have a dataset relating the effects of engineering works on the level of salinity in a river before and after the works. I have modelled this using linear mixed effects models to determine if the significance and level of the response to the works. I am wanting to calculate the se of differe

Re: [R] how to superimpose 2 matrices of different sizes

2010-09-15 Thread David Winsemius
On Sep 15, 2010, at 7:40 PM, Dennis Murphy wrote: Hi: Try something like this: ind <- as.matrix(expand.grid(rownames(U), colnames(U))) Uempty[ind] <- U[ind] ind should be a two column matrix of (row, col) indices. Then just replace the values of Uempty associated with those indices with th

Re: [R] labeling outliers with subject numberss

2010-09-15 Thread Peter Ehlers
Kevin, On 2010-09-15 16:37, Phil Spector wrote: Kevin - Here's one way: z = boxplot(mydata$score,outline=FALSE,ylim=range(mydata$score)) text(1,z$out,SubNo[which(score == z$out)]) - Phil Spector Statistical

Re: [R] how to superimpose 2 matrices of different sizes

2010-09-15 Thread Dennis Murphy
Hi: Try something like this: ind <- as.matrix(expand.grid(rownames(U), colnames(U))) Uempty[ind] <- U[ind] ind should be a two column matrix of (row, col) indices. Then just replace the values of Uempty associated with those indices with the corresponding entries of U. HTH, Dennis On Wed, Sep

Re: [R] how to superimpose 2 matrices of different sizes

2010-09-15 Thread Jorge Ivan Velez
Hi Nicolas, Try (untested): with(pop, table(factor(xloc, levels = 1:20), factor(loc, levels = 1:25))) HTH, Jorge On Wed, Sep 15, 2010 at 7:31 PM, Nicolas Gutierrez <> wrote: > Hi All, > > I’m trying to superimpose (or "add") two matrices: > > 1. resulting from a table function with frequenci

[R] how to superimpose 2 matrices of different sizes

2010-09-15 Thread Nicolas Gutierrez
Hi All, I’m trying to superimpose (or "add") two matrices: 1. resulting from a table function with frequencies: > U=table(pop$xloc, pop$yloc)) 14 15 16 17 18 19 20 21 22 5 0 0 0 0 0 0 0 0 0 7 0 0 0 0 0 0 0 0 0 8 0 0 0 0 0 0 0 0 0 9 0 0 0 0 0

Re: [R] Changing variable class problems

2010-09-15 Thread Joshua Wiley
Hi Richard, Something like workf[ , columns] <- data.frame(lapply(workf[, columns], as.numeric)) should do what you're after. However, this is really a bit of a work around to the real problem. Can you provide more details on the csv file you are reading in? Perhaps the first couple rows or som

Re: [R] aggregate, by, *apply

2010-09-15 Thread Abhijit Dasgupta, PhD
I would approach this slightly differently. I would make func a function of x and y. func <- function(x,y){ m <- median(x) return(m > 2 & m < y) } Now generate tmp just as you have. then: require(plyr) res <- daply(tmp, .(z), summarise, res=func(x,y)) I believe this does the trick A

Re: [R] aggregate, by, *apply

2010-09-15 Thread David Winsemius
On Sep 15, 2010, at 5:45 PM, Mark Ebbert wrote: Dear R gurus, I regularly come across a situation where I would like to apply a function to a subset of data in a dataframe, but I have not found an R function to facilitate exactly what I need. More specifically, I'd like my function to ha

Re: [R] aggregate, by, *apply

2010-09-15 Thread Dennis Murphy
Hi: Try this: library(plyr) func <- function(x, y) { m <- median(x) if(m > 2 & m < mean(y)) ret <- TRUE else ret <- FALSE ret } ddply(tmp, .(z), summarise, r = func(x, y)) z r 1 a FALSE 2 b TRUE 3 c TRUE HTH, Dennis On Wed, Sep 15, 2010 at 2:45 PM, Mark Ebbert wrote: >

[R] Changing variable class problems

2010-09-15 Thread Richard Barfield
I'm reading in some data from a csv file, and it's reading in some of the columns as character variables instead of numeric. I know I can fix this by doing as.numeric for each of the columns, but the problem is I have a LOT of different quantitative variables that I would have to do this for. I've

[R] aggregate, by, *apply

2010-09-15 Thread Mark Ebbert
Dear R gurus, I regularly come across a situation where I would like to apply a function to a subset of data in a dataframe, but I have not found an R function to facilitate exactly what I need. More specifically, I'd like my function to have a context of where the data it's analyzing came from

[R] loop, list() and non-numeric argument to binary operator

2010-09-15 Thread Chien-Pang Chin
Hi all: I have a problem when I want to do operation a sequence or matrix created by loop and list() or data.frame(). Here is the example. > for(i in 1:n) (k[i]=list(c(0:max[i]))) > k[1]+1 Error in k[1] + 1 : non-numeric argument to binary operator What should I do to correct this pro

Re: [R] From string to numeric

2010-09-15 Thread Jorge Ivan Velez
Hi Cristofer, Try as.numeric(strsplit(x, ",")[[1]]) HTH, Jorge On Wed, Sep 15, 2010 at 4:42 PM, Christofer Bogaso <> wrote: > Hi, I have a string like "1,2,5,7,8". > > From this I want to create a numeric vector of length 5 (total number > of numbers in above string), with each element will b

Re: [R] labeling outliers with subject numberss

2010-09-15 Thread Phil Spector
Kevin - Here's one way: z = boxplot(mydata$score,outline=FALSE,ylim=range(mydata$score)) text(1,z$out,SubNo[which(score == z$out)]) - Phil Spector Statistical Computing Facility

Re: [R] labeling outliers with subject numberss

2010-09-15 Thread Clint Bowman
SubNo[identify(rep(1,8),mydata$score)] -- Clint BowmanINTERNET: cl...@ecy.wa.gov Air Quality Modeler INTERNET: cl...@math.utah.edu Department of Ecology VOICE: (360) 407-6815 PO Box 47600FAX:(360) 407-7

[R] labeling outliers with subject numberss

2010-09-15 Thread Kevin Burnham
How can I get the outlier in this boxplot of "Score" to be represented by the corresponding value in "SubNo"? score=c(6,6,7,14,5,7,6,8) SubNo=1:8 mydata=data.frame(SubNo, score) boxplot(mydata$score) Thanks! Kevin [[alternative HTML version deleted]] ___

[R] Inconvenient behavior of as.data.frame() for lists without names

2010-09-15 Thread Magnus Thor Torfason
Hi all, I ran into a small issue when converting a list of vectors to a data frame. The Issue I'm having is described by the snippet below: # # Convert a list of vectors into a data.frame strlen = 256 s.long.a = paste( letters[1+(0:strle

Re: [R] loop, list() and non-numeric argument to binary operator

2010-09-15 Thread Phil Spector
Chien-Pang - Here's a *reproducible* example that should answer your question: k = list() n = 10 max = 10:19 for(i in 1:n) (k[i]=list(c(0:max[i]))) k[[1]] + 1 [1] 1 2 3 4 5 6 7 8 9 10 11 - Phil Spector

[R] loop, list() and non-numeric argument to binary operator

2010-09-15 Thread Chien-Pang Chin
Hi all: I have a problem when I want to do operation a sequence or matrix created by loop and list() or data.frame(). Here is the example. > for(i in 1:n) (k[i]=list(c(0:max[i]))) > k[1]+1 Error in k[1] + 1 : non-numeric argument to binary operator What should I do to correct this pro

Re: [R] lapack in R 2.11.1 (Ubuntu 10.04.1)

2010-09-15 Thread Matias Salibian-Barrera
Thanks to all that helped. I had not compiled R myself, so it was rather puzzling. I finally decided to re-install R from scratch. First I verified I had the right repositories listed and ran: sudo apt-get update sudo apt-get remove r-base sudo apt-get autoremove sudo apt-get install r-base

Re: [R] lapack in R 2.11.1 (Ubuntu 10.04.1)

2010-09-15 Thread Dirk Eddelbuettel
On 15 September 2010 at 13:48, Matias Salibian-Barrera wrote: | I'm trying to install the package RcppArmadillo in my R 2.11.1 which I installed | and regularly update via Ubuntu's repositories. We welcome questions on Rcpp et al on the rcpp-devel list. There is also the r-sig-debian list for

Re: [R] lapack in R 2.11.1 (Ubuntu 10.04.1)

2010-09-15 Thread Douglas Bates
On Wed, Sep 15, 2010 at 3:48 PM, Matias Salibian-Barrera wrote: > Hi there, > > I'm trying to install the package RcppArmadillo in my R 2.11.1 which I > installed > and regularly update via Ubuntu's repositories. > > > When I try to install RcppArmadillo from CRAN I get: > >> install.packages('Rc

Re: [R] From string to numeric

2010-09-15 Thread Greg Snow
> x <- "1,2,5,7,8" > as.numeric(unlist(strsplit(x, ','))) [1] 1 2 5 7 8 -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On

[R] Moving non-zero matrix entries to different locations on the matrix

2010-09-15 Thread Juliet Ndukum
I have a matrix: C1 C2 C3 C4 C5 C6 C7 C8 C9 C10 C11 C12 R1 0 0 0 0 0 5 0 0 0 0 0 0 R2 0 0 0 0 0 3 0 0 0 0 0 0 R3 0 0 0 0 0 0 4 0 0 0 0 0 R4 0 0 0 0 0 0 2 0 0 0 0 0 R5 1 0 0 0 0 0 0 0 0 0 0 0 R6 8 0 0 0 0 0 0

Re: [R] From string to numeric

2010-09-15 Thread Henrique Dallazuanna
Try this: x <- scan(textConnection("1,2,5,7,8"), sep = ",") On Wed, Sep 15, 2010 at 5:42 PM, Christofer Bogaso < bogaso.christo...@gmail.com> wrote: > Hi, I have a string like "1,2,5,7,8". > > From this I want to create a numeric vector of length 5 (total number > of numbers in above string), wi

[R] From string to numeric

2010-09-15 Thread Christofer Bogaso
Hi, I have a string like "1,2,5,7,8". >From this I want to create a numeric vector of length 5 (total number of numbers in above string), with each element will be the number in above string. Is there any possibility to doing this? Thanks and regards,

Re: [R] cochran-grubbs tests results

2010-09-15 Thread Greg Snow
The fact that you are asking what a p-value is indicates that you do not have enough of a background for us to be able to help you. It is not that we do not want to help, just that anything we could say in an e-mail would likely do more harm than good at this point. You should either consult w

[R] lapack in R 2.11.1 (Ubuntu 10.04.1)

2010-09-15 Thread Matias Salibian-Barrera
Hi there, I'm trying to install the package RcppArmadillo in my R 2.11.1 which I installed and regularly update via Ubuntu's repositories. When I try to install RcppArmadillo from CRAN I get: > install.packages('RcppArmadillo', lib='~/myRlibs') [...] g++ -shared -o RcppArmadillo.so RcppArmad

Re: [R] approxfun returning value higher than I would expect

2010-09-15 Thread stephen sefick
x <- c(-0.48,-0.48,-0.42,-0.26,0.58,0.48,0.47,0.54,0.5,0.52,0.52,0.56,0.58,0.61,0.68) y <- c(0,0.2,0.4,0.6,0.8,1,1.2,1.4,1.6,1.8,2,2.2,2.4,2.6,2.8) s <- approxfun(x[4:5], y[4:5], ties=mean) s(0) #This is the value that I want. The first zero crossing in the order of y. #In other words in betw

Re: [R] question on "optim"

2010-09-15 Thread Hey Sky
thanks. Ravi and Nash. I will read the new package and may use it after I am familiar with it. I may bother both of you when I have questions.thanks for that in advance. Nan from Montreal Hi Nan, You can take a look at the "optimx" package on CRAN. John Nash and I wrote this package t

Re: [R] Model fitting

2010-09-15 Thread Erik Iverson
Diogo B. Provete wrote: I have a data set and I want to procedure to model fitting (e.g., Poisson, Gausian, binomial, quasipoisson etc.). I'd like to know if there is an easier way to do this in R. Easier than what ? There is no shortage of R functions and packages to fit almost any type of

Re: [R] approxfun returning value higher than I would expect

2010-09-15 Thread stephen sefick
Thanks and I'll strip the code down even more in future posts. Stephen On Wed, Sep 15, 2010 at 3:05 PM, Duncan Murdoch wrote: >  On 15/09/2010 3:48 PM, stephen sefick wrote: >> >> Below is the code that I am using in a much larger function.  I would >> expect a bankfull measure at zero to be bet

[R] Model fitting

2010-09-15 Thread Diogo B. Provete
I have a data set and I want to procedure to model fitting (e.g., Poisson, Gausian, binomial, quasipoisson etc.). I'd like to know if there is an easier way to do this in R. Thank you in advance. -- Atenciosamente, Diogo Borges Provete == Biólogo Mestre em Biologia A

Re: [R] approxfun returning value higher than I would expect

2010-09-15 Thread Duncan Murdoch
On 15/09/2010 3:48 PM, stephen sefick wrote: Below is the code that I am using in a much larger function. I would expect a bankfull measure at zero to be between 0.6 and 0.8 approxfun is returning 0.8136986. I am sure that I am missing something. measure_bkf<- (structure(list(measurment_num =

Re: [R] optim with BFGS--what may lead to this, a strange thing happened

2010-09-15 Thread Hey Sky
sorry, a typo. the following code is an example from my computer and the real one just has more variables. the w[11] is the w[5] in the wden equation. the value of wden is calculated based on the ifelse condition. it may equal to 1 when one is working; if not, it will equal to the value from

[R] contr.sum, model summaries and `missing' information

2010-09-15 Thread Christophe Rhodes
Hi, I have a dataset with a response variable and multiple factors with more than two levels, which I have been fitting using lm() or glm(). In these fits, I am generally more interested in deviations from the global mean than I am in comparing to a "control" group, so I use contr.sum() as the fa

[R] approxfun returning value higher than I would expect

2010-09-15 Thread stephen sefick
Below is the code that I am using in a much larger function. I would expect a bankfull measure at zero to be between 0.6 and 0.8 approxfun is returning 0.8136986. I am sure that I am missing something. measure_bkf <- (structure(list(measurment_num = c(0, 0.2, 0.4, 0.6, 0.8, 1, 1.2, 1.4, 1.6, 1.8

Re: [R] Creating publication-quality plots for use in Microsoft Word

2010-09-15 Thread Abhijit Dasgupta, PhD
On 9/15/10 10:38 AM, dadrivr wrote: Hi everyone, I am trying to make some publication-quality plots for use in Microsoft Word, but I am having trouble creating high-quality plots that are supported by Microsoft Word. If I use the R plot function to create the figure, the lines are jagged, and

Re: [R] How to uncompress a gz file in R

2010-09-15 Thread steven mosher
Wongsang, Just to be clear R.utils is different than "utils" As Henrik notes gunzip has been in R.utils ( see http://cran.r-project.org/) for some time. It works like a champ. R.utils is a great package. On Wed, Sep 15, 2010 at 9:30 AM, Wonsang You wrote: > Dear Henrik, > > Thank you so mu

[R] optim with BFGS--what may lead to this, a strange thing happened

2010-09-15 Thread Hey Sky
Dear R Users on a self-written function for calculating maximum likelihood probability (plz check function code at the bottom of this message), one value, wden, suddenly jump to zero. detail info as following: w[11]=2.14 lnw=2.37 2.90 3.76 ... regw=1.96 1.77 1.82 w

Re: [R] Format Data Issue??

2010-09-15 Thread Dennis Murphy
Hi: This isn't the most elegant way, I'm sure, but here's one approach. library(reshape) # read in your data...I had to surround the text strings with quotes because of the spaces df <- read.table(textConnection(" TractID StandID Species CruiseDate DBHClassTreesPerAcre 'Carbon Stand

[R] test to see if a s4 property is assigned?

2010-09-15 Thread darckeen
Class("person",representation(age="numeric",weight="numeric")) [1] "person" > bob <- new("person",age=30) > is.null(b...@weight) [1] FALSE > b...@weight numeric(0) > b...@weight == numeric(0) logical(0) How can i test to see if a s4 property is assigned? -- View this message in context: http:/

Re: [R] Homogeneity of regression slopes

2010-09-15 Thread Doug Adams
That's good insight, and gives me some good ideas for what direction to this. Thanks everyone ! Doug P.S. - I guess if you have a significant interaction, that implies the slopes of the individual regression lines are significantly different anyway, doesn't it... On Tue, Sep 14, 2010 at 11:33

Re: [R] Sas to R

2010-09-15 Thread Sarah Jilani
Thanks Josh and Dan! I got it to work using the following code that Dan had suggested. x """D:\Program Files\R\R-2.9.2\bin\R.exe"" --no-save --quiet < ""&rsource.\Rtest.R"" > ""&rsource.\Rtest.log"""; Thanks for your help!! :) Sarah On Wed, Sep 15, 2010 at 2:58 PM, Joshua Wiley wrote: > Hi

Re: [R] Sas to R

2010-09-15 Thread Joshua Wiley
Hi Sarah, Just a couple additional notes to what's been said: 1) It seems like R CMD BATCH might be easier 2) If the space in Program Files is causing issues, you can use the Windows environment variable %PROGRAMFILES% (which also means you do not need the drive letter. 3) I find it handy to defi

Re: [R] Sas to R

2010-09-15 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Sarah Jilani > Sent: Wednesday, September 15, 2010 10:44 AM > To: r-help@r-project.org > Subject: [R] Sas to R > > Hi, > > I need to call an R program from Sas. I have tried usi

Re: [R] Sas to R

2010-09-15 Thread Erik Iverson
David Winsemius wrote: On Sep 15, 2010, at 1:44 PM, Sarah Jilani wrote: Hi, I need to call an R program from Sas. I have tried using the following code in Sas using the x command but it just calls up dos and says I went searching for a worked example and found this: http://www.nesug.or

Re: [R] Sas to R

2010-09-15 Thread David Winsemius
On Sep 15, 2010, at 1:44 PM, Sarah Jilani wrote: Hi, I need to call an R program from Sas. I have tried using the following code in Sas using the x command but it just calls up dos and says I went searching for a worked example and found this: http://www.nesug.org/proceedings/nesug08/sa/

Re: [R] Scripting help

2010-09-15 Thread Philipp Pagel
Oh - and also have a look at the R graph gallery for inspiration: http://addictedtor.free.fr/graphiques/ cu Philipp -- Dr. Philipp Pagel Lehrstuhl für Genomorientierte Bioinformatik Technische Universität München Wissenschaftszentrum Weihenstephan Maximus-von-Imhof-Forum 3 85354 Frei

Re: [R] Sas to R

2010-09-15 Thread Erik Iverson
Sarah, This is a SAS question, not R. However, it seems clear that it has something to do with the fact that there are spaces in the command that you're sending to Windows. Maybe try calling with the 'short directory name' notation, I forget what that's called in Windows. Or else follow-up on

Re: [R] Scripting help

2010-09-15 Thread Philipp Pagel
On Wed, Sep 15, 2010 at 12:22:15PM -0400, Ayyappa Chaturvedula wrote: > Dear all, I am new to R and this group. I have good experience in S > scripts. I need some orientation on data imports, general plotting > functions. Can you please direct me? Welcome to R. Coming from an S background you sho

Re: [R] How to uncompress a gz file in R

2010-09-15 Thread Henrik Bengtsson
Hi. On Wed, Sep 15, 2010 at 9:30 AM, Wonsang You wrote: > Dear Henrik, > Thank you so much for your kind help. Unfortunately, I could not find out > any function such as 'gunzip' in R.utils package. Hmm... it's been there since at least 2005. library("R.utils"); help("gunzip") See the example.

[R] Sas to R

2010-09-15 Thread Sarah Jilani
Hi, I need to call an R program from Sas. I have tried using the following code in Sas using the x command but it just calls up dos and says 'D:\Program' is not recognized as an internal or external command, operable program or batch file. ] SAS CODE: options xwait xsync; %let Rsource=S:\EPI_Dat

[R] Format Data Issue??

2010-09-15 Thread Randy Cass
R Users, I am new to R and have tried to figure out how to automate this process instead of using excel. I have read in this dataframe into r with read.table. I need to reshape the data from the first table into the format of the second table. TractID StandID Species CruiseDate DBHClass

Re: [R] Creating publication-quality plots for use in Microsoft Word

2010-09-15 Thread Mark Difford
>> I'd prefer to stick with JPEG, TIFF, PNG, or the like. I'm not sure EPS would fly. Preferring to stick with bitmap formats (like JPEG, TIFF, PNG) is likely to give you the jagged lines and other distortions you profess to want to avoid. EPS (encapsulated postscript, which handles vector+bitm

Re: [R] Creating publication-quality plots for use in Microsoft Word

2010-09-15 Thread Max Kuhn
You might want to check out the Reproducible Research task view: http://cran.r-project.org/web/views/ReproducibleResearch.html There is a section on Microsoft formats, as well as other formats that can be converted. Max On Wed, Sep 15, 2010 at 11:49 AM, Thomas Lumley wrote: > On Wed, 15 S

Re: [R] How to uncompress a gz file in R

2010-09-15 Thread Wonsang You
Dear Henrik, Thank you so much for your kind help. Unfortunately, I could not find out any function such as 'gunzip' in R.utils package. Instead, I could be successful by using the following command. system("gunzip filename") On the other hand, the function 'gzfile' supports the compression as g

Re: [R] Difficulty creating Julian day in data frame

2010-09-15 Thread David Winsemius
On Sep 15, 2010, at 12:23 PM, David Winsemius wrote: On Sep 15, 2010, at 12:05 PM, Sean Parks wrote: Hi, I'm attempting to add a "Julian Day" column to a data frame. Here is my code and the resulting data frame: vic.data <- read.table("C:/VIC/data/vic.data.csv", header=F) name

[R] Computing effect sizes based on mixed models

2010-09-15 Thread Andrea Meyer
In an intervention study with subjects randomly allocated to two treatments (treat A and B) and three time points (time) plus an additional baseline measurement (dv_base), I've set up the following model to test for differences in temporal courses of treatments for the outcome (dv), thereby allo

Re: [R] characters in a string

2010-09-15 Thread raje...@cse.iitm.ac.in
great! Thanks - Original Message - From: David Winsemius To: raje...@cse.iitm.ac.in Cc: r-help Sent: Wed, 15 Sep 2010 21:12:27 +0530 (IST) Subject: Re: [R] characters in a string On Sep 15, 2010, at 11:16 AM, raje...@cse.iitm.ac.in wrote: > > Hi, > > I need to check if a string "a,b,c

Re: [R] Difficulty creating Julian day in data frame

2010-09-15 Thread David Winsemius
On Sep 15, 2010, at 12:05 PM, Sean Parks wrote: Hi, I'm attempting to add a "Julian Day" column to a data frame. Here is my code and the resulting data frame: vic.data <- read.table("C:/VIC/data/vic.data.csv", header=F) names(vic.data) <- c("year", "month", "day", "precip", "ev

[R] Scripting help

2010-09-15 Thread Ayyappa Chaturvedula
Dear all, I am new to R and this group. I have good experience in S scripts. I need some orientation on data imports, general plotting functions. Can you please direct me? Regards,Ayyappa Chaturvedula __ R-help@r-project.org mailing list https://s

[R] Difficulty creating Julian day in data frame

2010-09-15 Thread Sean Parks
Hi, I'm attempting to add a "Julian Day" column to a data frame. Here is my code and the resulting data frame: vic.data <- read.table("C:/VIC/data/vic.data.csv", header=F) names(vic.data) <- c("year", "month", "day", "precip", "evap", "runoff", "baseflow", "Tsup", "SM1", "SM2",

Re: [R] relative risk regression with survey data

2010-09-15 Thread Thomas Lumley
On Wed, 15 Sep 2010, Ravi Varadhan wrote: Dear Thomas, You said, "the log-binomial model is very non-robust when the fitted values get close to 1, and there is some controversy over the best approach." Could you please point me to a paper that discusses the issues? I have written some code to

Re: [R] Creating publication-quality plots for use in Microsoft Word

2010-09-15 Thread Thomas Lumley
On Wed, 15 Sep 2010, dadrivr wrote: Thanks for your help, guys. I'm looking to produce a high-quality plot (no jagged lines or other distortions) with a filetype that is accepted by Microsoft Word on a PC and that most journals will accept. That's why I'd prefer to stick with JPEG, TIFF, PNG,

Re: [R] Creating publication-quality plots for use in Microsoft Word

2010-09-15 Thread Marc Schwartz
On Sep 15, 2010, at 10:25 AM, dadrivr wrote: > > Thanks for your help, guys. I'm looking to produce a high-quality plot (no > jagged lines or other distortions) with a filetype that is accepted by > Microsoft Word on a PC and that most journals will accept. That's why I'd > prefer to stick with

Re: [R] characters in a string

2010-09-15 Thread David Winsemius
On Sep 15, 2010, at 11:16 AM, raje...@cse.iitm.ac.in wrote: Hi, I need to check if a string "a,b,c,d" is delimited by two "" 's as efficiently as possible(I need to do this a lot of times) and return TRUE. Can someone suggest a good technique? > txt <- "a,b,c,d" > > grep("^.+$", txt) [1

Re: [R] Creating publication-quality plots for use in Microsoft Word

2010-09-15 Thread Gabor Grothendieck
On Wed, Sep 15, 2010 at 11:25 AM, dadrivr wrote: > > Thanks for your help, guys.  I'm looking to produce a high-quality plot (no > jagged lines or other distortions) with a filetype that is accepted by > Microsoft Word on a PC and that most journals will accept.  That's why I'd > prefer to stick w

Re: [R] characters in a string

2010-09-15 Thread Romain Francois
Le 15/09/10 17:16, raje...@cse.iitm.ac.in a écrit : Hi, I need to check if a string "a,b,c,d" is delimited by two"" 's as efficiently as possible(I need to do this a lot of times) and return TRUE. Can someone suggest a good technique? Hi Rajesh, > f <- function( x ) grepl( "^.*$", x ) > f(

Re: [R] characters in a string

2010-09-15 Thread Marc Schwartz
On Sep 15, 2010, at 10:16 AM, raje...@cse.iitm.ac.in wrote: > > Hi, > > I need to check if a string "a,b,c,d" is delimited by two "" 's > as efficiently as possible(I need to do this a lot of times) and return TRUE. > Can someone suggest a good technique? See ?grep and ?regex > grepl("^.*$

Re: [R] multiple cores/building fails

2010-09-15 Thread Gregory Ryslik
Hi, That seems to be the case. Is there a way that I can put an object in some global place where all the workers can access it? Doing the following at the start (before I make multiple workers) does not work: Assign('global.control', control, globalenv()) Thanks for your help! Kind regards, G

[R] symmetric dotplot? (Wilkinson 1999, Am Stat 53 (3) 276-281

2010-09-15 Thread Paul Artes
DeaR all, The stripchart function (graphics) is provides jittered and stacked univariate scatterplots, but I wonder if anyone has implemented a *symmetric* version of this - as in the lower panel of Wilkinson's paper: http://www.jstor.org/stable/2686111 I have looked through several functions i

Re: [R] Creating publication-quality plots for use in Microsoft Word

2010-09-15 Thread dadrivr
Thanks for your help, guys. I'm looking to produce a high-quality plot (no jagged lines or other distortions) with a filetype that is accepted by Microsoft Word on a PC and that most journals will accept. That's why I'd prefer to stick with JPEG, TIFF, PNG, or the like. I'm not sure EPS would f

Re: [R] Contour line coordinates

2010-09-15 Thread Duncan Murdoch
On 15/09/2010 11:13 AM, Tonja Krueger wrote: Hi all, I used contour() to add contour lines to a plot. Now I’m wondering if there is a way to get an output of the calculated x- and y- coordinates of the contour lines? ?contourLines Duncan Murdoch ___

[R] characters in a string

2010-09-15 Thread raje...@cse.iitm.ac.in
Hi, I need to check if a string "a,b,c,d" is delimited by two "" 's as efficiently as possible(I need to do this a lot of times) and return TRUE. Can someone suggest a good technique? [[alternative HTML version deleted]] __ R-help@r-project.

Re: [R] Contour line coordinates

2010-09-15 Thread David Winsemius
On Sep 15, 2010, at 11:13 AM, Tonja Krueger wrote: Hi all, I used contour() to add contour lines to a plot. Now I’m wondering if there is a way to get an output of the calculated x- and y- coordinates of the contour lines? ?contourLines # as was suggested to be the first "See(n) Also"

Re: [R] Package build and install under Windows

2010-09-15 Thread Tao
Thanks. It seems that both Rtools210.exe and Rtools211.exe support R 1.10.x, which one is better for R 2.10.1. -- View this message in context: http://r.789695.n4.nabble.com/Package-build-and-install-under-Windows-tp2539509p2540713.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] About choosing file

2010-09-15 Thread Stephen Liu
Hi Henrique, Thanks for your advice which works for me. B.R. Stephen L From: Henrique Dallazuanna Cc: R-help@r-project.org Sent: Wed, September 15, 2010 10:24:01 PM Subject: Re: [R] About choosing file You can try tcltk: library(tcltk) tk_choose.files()

[R] Contour line coordinates

2010-09-15 Thread Tonja Krueger
Hi all, I used contour() to add contour lines to a plot. Now I’m wondering if there is a way to get an output of the calculated x- and y- coordinates of the contour lines? Tonja __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo

Re: [R] Creating publication-quality plots for use in Microsoft Word

2010-09-15 Thread Marc Schwartz
That approach will be unique to OSX, upon which PDF is a default format. You can copy and paste from a PDF document using Preview into Office or iWork or similar apps. However, when subsequently displaying that content on a non-OSX system, the content will be shown as a bitmap not as the vector

Re: [R] Creating publication-quality plots for use in Microsoft Word

2010-09-15 Thread Gabor Grothendieck
On Wed, Sep 15, 2010 at 10:38 AM, dadrivr wrote: > > Hi everyone, > > I am trying to make some publication-quality plots for use in Microsoft > Word, but I am having trouble creating high-quality plots that are supported > by Microsoft Word. > > If I use the R plot function to create the figure, t

Re: [R] Creating publication-quality plots for use in Microsoft Word

2010-09-15 Thread Bryan Hanson
There's many ways to solve this, but you are close to one already: Make the pdf, put the cursor where you want it in the document, then on the menu bar Insert --> Picture --> From File... And navigate to the file. This works on the Mac, and seems to store the picture internally in a different way

[R] Creating publication-quality plots for use in Microsoft Word

2010-09-15 Thread dadrivr
Hi everyone, I am trying to make some publication-quality plots for use in Microsoft Word, but I am having trouble creating high-quality plots that are supported by Microsoft Word. If I use the R plot function to create the figure, the lines are jagged, and the picture is not of high quality (sa

[R] Odp: Programming: loop versus vector oriented

2010-09-15 Thread Petr PIKAL
Hi I do not want to go too much deep to internals of your function. What do you suppose to get as the result. If you want to get results of your function for a vector of reynolds and dk you can use function outer and probably get rid of for cycle in the function. outer(c(100, 530,2410), c(10,

  1   2   >