[R] Help in the mtext function

2009-10-05 Thread RAVI KAPOOR
Hi Can anyone please help me in understanding the utility of padj and outer (logical) values in the '*mtext function*' given below are the output I generated on using the below code which is different from the formula description on r help par(mfrow=c(2,1),xpd=NA) y1 - rnorm(100)

[R] Saving each output of a loop into something that can be graphed

2009-10-05 Thread RRRRRR99
Hi, from the code below; whats happening is i want to plot how the [1,9] entry changes as the matrx changes, print[] gives the values one after the other, but only the last value is saved so my graph has only one point. does anyone know how i can merge all the outputs into one dataframe or

[R] [R-pkgs] General mixed effects Cox models

2009-10-05 Thread Terry Therneau
After an extremely long gestation, a new version of the coxme package is now available on CRAN. This function fits very general mixed-effects Cox models using an lmer-like syntax. For instance here is a model that fits a random treatment effect, using data from a multi-study collaboration.

Re: [R] nls not accepting control parameter?

2009-10-05 Thread Rainer M Krug
On Fri, Oct 2, 2009 at 7:23 PM, Peter Ehlers ehl...@ucalgary.ca wrote: Hello Rainer, I think that your problem is with trying to fit a logistic model to data that don't support that model. Removing the first two points from your data will work (but of course it may not represent reality).

[R] R: help with regexp mass substitution

2009-10-05 Thread Luca Braglia
Mmm, just Friday ... :) Thank you jim gabor -Messaggio originale- Da: jim holtman [mailto:jholt...@gmail.com] Inviato: venerdì 2 ottobre 2009 14.12 A: Luca Braglia Cc: r-help@r-project.org Oggetto: Re: [R] help with regexp mass substitution You need perl=TRUE:

[R] [R-pkgs] DEoptim 2.0-0

2009-10-05 Thread Katharine Mullen
Dear All, We are happy to announce the release of the new version of DEoptim (version 2.0-0) which is now available from CRAN. The DEoptim package [3] performs Differential Evolution (DE) minimization, a genetic algorithm-based optimization technique [2,3]. This allows robust minimization

[R] try function

2009-10-05 Thread christophe dutang
Hi all, I'm using the try function for data import with read.csv function. I would like to know if there is a double allocation of memory when using this code test.t - try(input1 - read.csv(myfile.csv) ) compared to this one test.t - try( read.csv(myfile.csv) ) I think for the first code, both

Re: [R] The nature of evidence (was Re: Urgently needed Exercisesolutions related to PracticalData)

2009-10-05 Thread Daniel Malter
You are right, Patrick, there is no evidence that he is - as much as there is no evidence that he is not. There is no evidence that he is in Switzerland; there is no evidence that he is in Computer Science; and there is no evidence that he is in fact Mahesh. It seems to me we are now redeclaring

Re: [R] ggplot2: proper use of facet_grid inside a function

2009-10-05 Thread ONKELINX, Thierry
Dear Bryan, In the ggplot() function you can choose between aes() and aes_string(). In the first you need to hardwire the variable names, in the latter you can use objects which contain the variable names. So in your case you need aes_string(). Unfortunatly, facet_grid() works like aes() and not

Re: [R] .Rprofile file

2009-10-05 Thread Petr PIKAL
Hi I modify Rprofile.site file in etc directory in installed version of R and I load all packages and data files I use through it. You shall also go through file Rconsole in the same directory. Regards Petr r-help-boun...@r-project.org napsal dne 02.10.2009 13:03:25: I want to use the

[R] Unusual error while using coxph

2009-10-05 Thread Laura Bonnett
Hi all, I'm very confused! I've been using the same code for many weeks without any bother for various covariates. I'm now looking at another covaraite and whenever I run the code you can see below I get an error message: Error in rep(0, nrow(data)) : invalid 'times' argument This code works:

Re: [R] GAM question

2009-10-05 Thread Simon Wood
If you mean the values of the smooth function for different values of its argument then take a look at setting `type=terms' for `predict.gam'... the returns predictions split up by individual smooth terms (and any parametric terms) On Thursday 01 October 2009 12:49, Daniel Rabczenko wrote:

[R] convert RData to txt

2009-10-05 Thread mykhwab
hello all, will you plz tell me how can i convert RData files to txt,,, __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide

Re: [R] else if statement error

2009-10-05 Thread Martin Maechler
DW == David Winsemius dwinsem...@comcast.net on Sat, 3 Oct 2009 12:56:51 -0400 writes: DW On Oct 3, 2009, at 11:54 AM, Chen Gu wrote: Hello, I am doing a simple if else statement in R. But it always comes out error such as 'unexpected error' There are

Re: [R] Parsing Files in R (USGS StreamFlow data)

2009-10-05 Thread Gabor Grothendieck
Repeat the DD calculation but with this pattern instead: pat - ^# +USGS +([0-9]+) +(.*) and then merge DD with DF: DDdf - data.frame(gauge = as.numeric(DD[,1]), gauage_name = DD[,2]) both - merge(DF, DDdf, by = gauge, all.x = TRUE) On Sun, Oct 4, 2009 at 10:14 PM, Gabor Grothendieck

[R] COURSE: Introduction to Metabolomics and biomarker research

2009-10-05 Thread Matthias Kohl
Introduction to Metabolomics and biomarker research. The course will take place in Innsbruck, 16th to 17th November 2009, and will be held in German. For more details see: http://www.gdch.de/vas/fortbildung/kurse/fortbildung2009.htm#1175 -- Dr. Matthias Kohl www.stamats.de

[R] How to get NA's into the output of xtabs?

2009-10-05 Thread Tony Breyal
Dear all, Lets say I have the following data frame: df1 - data.frame(Show=c('Star Trek', 'Babylon 5', 'Dr Who'), Size=c(0.7, 0.0, 0.701), Date=as.Date(c('2007-08-03', '2007-08-03', '2007-08-03'), format='%Y-%m-%d')) df2 - data.frame(Show=c('Star Trek', 'Dr Who', 'Torchwood'), Size=c(0.8,

Re: [R] How to get NA's into the output of xtabs?

2009-10-05 Thread jim holtman
Try the reshape package: my.df Show Size Date 1 Babylon 5 0.000 2007-08-03 2Dr Who 0.701 2007-08-03 3Dr Who 0.850 2007-08-04 4Dr Who 0.850 2007-08-05 5 Star Trek 0.700 2007-08-03 6 Star

Re: [R] convert RData to txt

2009-10-05 Thread Paul Hiemstra
mykh...@gmail.com wrote: hello all, will you plz tell me how can i convert RData files to txt,,, __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] Ubuntu, Revolutions, R

2009-10-05 Thread Hans W. Borchers
I updated to Ubuntu 9.10 Beta yesterday, and yes I do see the same message and I am a bit irritated. I don't want to read these 'marketing' lines any time I start up R. I simply deleted the lines from /etc/R/Rprofile.site for now, but I am still wondering who put that in. Is there any deeper

Re: [R] convert RData to txt

2009-10-05 Thread Henrique Dallazuanna
You can try something about like this: lapply(ls(), function(obj)cat(\n, obj, -, paste(deparse(get(obj)), collapse = \n), file = 'RData.txt', append = TRUE)) source('RData.txt') On Mon, Oct 5, 2009 at 4:00 AM, mykh...@gmail.com wrote: hello all, will you plz tell me how can i convert RData

Re: [R] ggplot2: proper use of facet_grid inside a function

2009-10-05 Thread Bryan Hanson
Thanks Thierry for the work-around. I was out of ideas. I had looked around for the facet_grid() analog of aes_string(), and concluded there wasn't one. The only thing I found was the notion of facet_grid(...) but apparently it is intended for some other use, as it doesn't work as I thought it

Re: [R] ggplot2: proper use of facet_grid inside a function

2009-10-05 Thread baptiste auguie
Hi, Whether or not what follows is to be recommended I don't know, but it seems to work, p - ggplot(diamonds, aes(carat, ..density..)) + geom_histogram(binwidth = 0.2) x = quote(cut) facets = facet_grid(as.formula(bquote(.~.(x p + facets HTH, baptiste 2009/10/5 Bryan Hanson

[R] Long for Loop- calling C from R - Parallel Computing

2009-10-05 Thread Antonio Paredes
Hello everyone, I'm running the following for loop to generate random variables in chunks of 60 at a time (l), here h is of order in millions (could be 5 to 6 millions), note that generating all the variables at once could have an impact on the final results for(j in 1:h){

Re: [R] Ubuntu, Revolutions, R

2009-10-05 Thread David M Smith
Andrew is correct: the upcoming release of Ubuntu (Karmic Koala) will feature the REvolution R distribution. (I am a REvolution Computing employee.) Our developers have been working with Canonical's representatives over the past several months to upgrade R in Ubuntu to 2.9.2 and to include the

Re: [R] Long for Loop- calling C from R - Parallel Computing

2009-10-05 Thread Karl Ove Hufthammer
In article 6f6f0fd60910050629p28c99209jcd7836353fd2d754 @mail.gmail.com, antonioparede...@gmail.com says... I'm running the following for loop to generate random variables in chunks of 60 at a time (l), here h is of order in millions (could be 5 to 6 millions), note that generating all the

Re: [R] convert RData to txt

2009-10-05 Thread David Winsemius
On Oct 5, 2009, at 3:00 AM, mykh...@gmail.com wrote: hello all, will you plz tell me how can i convert RData files to txt,,, ?load ?write.csv ?cat -- David Winsemius, MD Heritage Laboratories West Hartford, CT __ R-help@r-project.org mailing

Re: [R] ggplot2: proper use of facet_grid inside a function

2009-10-05 Thread hadley wickham
Whether or not what follows is to be recommended I don't know, but it seems to work, p - ggplot(diamonds, aes(carat, ..density..)) +  geom_histogram(binwidth = 0.2) x = quote(cut) facets = facet_grid(as.formula(bquote(.~.(x p + facets That's what I'd recommend. You can also just do

[R] Vim-R-plugin (new version)

2009-10-05 Thread Jakson A. Aquino
Dear R users, The author of Tinn-R (Jose Claudio Faria) now is co-author of Vim-R-plugin2, a plugin that makes it possible to send commands from the Vim text editor to R. We added many new key bindings, restructured the menu and created new Tool Bar buttons. The new version is available at:

Re: [R] ggplot2: proper use of facet_grid inside a function

2009-10-05 Thread baptiste auguie
Now why do I always come up with a twisted bquote() where a simple paste() would do! Thanks, baptiste 2009/10/5 hadley wickham h.wick...@gmail.com: Whether or not what follows is to be recommended I don't know, but it seems to work, p - ggplot(diamonds, aes(carat, ..density..)) +  

[R] gsub - replace multiple occurences with different strings

2009-10-05 Thread Martin Batholdy
Hi, I search a way to replace multiple occurrences of a string with different strings depending on the place where it occurs. I tried the following; x - c(xx y e d xx e t f xx e f xx) x - gsub(xx, c(x1, x2, x3, x4), x) what I want to get is; x = x1 y y e d x2 e t f x3 e f x4 but what I

Re: [R] Saving each output of a loop into something that can be graphed

2009-10-05 Thread John Kane
Define a matrix to hold the data and insert it into the loop? Something like mymat - matrix(rep(NA, 20), nrow=10) for(i in 1:10){ a - i b - i+1 mymat[i,] - c(a,b) } matplot(mymat) --- On Mon, 10/5/09, RR99 redhwanza...@hotmail.com wrote: From: RR99 redhwanza...@hotmail.com

[R] interpreting glmer results

2009-10-05 Thread Umesh Srinivasan
Hi all, I am trying to run a glm with mixed effects. My response variable is number of seedlings emerging; my fixed effects are the tree species and distance from the tree (in two classes - near and far).; my random effect is the individual tree itself (here called Plot). The command I've used

Re: [R] gsub - replace multiple occurences with different strings

2009-10-05 Thread William Dunlap
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Martin Batholdy Sent: Monday, October 05, 2009 7:34 AM To: r help Subject: [R] gsub - replace multiple occurences with different strings Hi, I search a way to replace

Re: [R] else if statement error

2009-10-05 Thread David Winsemius
On Oct 5, 2009, at 5:38 AM, Martin Maechler wrote: DW == David Winsemius dwinsem...@comcast.net on Sat, 3 Oct 2009 12:56:51 -0400 writes: DW On Oct 3, 2009, at 11:54 AM, Chen Gu wrote: Hello, I am doing a simple if else statement in R. But it always comes out error such as

[R] How to plot a Quadratic Model?

2009-10-05 Thread Juliano van Melis
Good day for all, I'm a beginner aRgonaut, thus I'm having a problem to plot a quadratic model of regression in a plot. First I wrote: plot(Y~X) and then I tried: abline(lm(Y~X+I(X^2)) but abline only uses the first two of three regression coefficients, thus I tried: line(lm(Y~X+I(X^2)) but

[R] box plot

2009-10-05 Thread kayj
Hi All, I was wondering if if it is possible to change the font style and the font size for x labels, y labels and the main title for a box plot? Thanks -- View this message in context: http://www.nabble.com/box-plot-tp25752195p25752195.html Sent from the R help mailing list archive at

[R] COM component/dll of R functions

2009-10-05 Thread Abbas R. Ali
Hi   I want to integrate my R function with C++/C# application and want to pass parameters from C++/C#. Can any body guide me in this regard?  Thanks [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] box plot

2009-10-05 Thread Henrique Dallazuanna
See family argument in ?par: par(family = 'serif') boxplot(rnorm(100), main = 'Title of Boxplot') On Mon, Oct 5, 2009 at 11:48 AM, kayj kjaj...@yahoo.com wrote: Hi All, I was wondering if if it is possible to change the font style and the font size for x labels, y labels and the main title

Re: [R] How to plot a Quadratic Model?

2009-10-05 Thread Ista Zahn
I hardly use base graphics so I'm no help there. You can do this easily with ggplot2 though: library(ggplot2) X - rnorm(100) Y - rnorm(100) - X^2 qplot(x=X, y=Y, geom=c(point, smooth), method=lm, formula = y ~ poly(x, 2)) Note that X is not x and Y is not y in the sense that formula = Y ~

[R] GLM quasipoisson error

2009-10-05 Thread atorso
Hello, I'm having an error when trying to fit the next GLM: model-glm(response ~ CLONE_M + CLONE_F + HATCHING +(CLONE_M*CLONE_F) + (CLONE_M*HATCHING) + (CLONE_F*HATCHING) + (CLONE_M*CLONE_F*HATCHING), family=quasipoisson) anova(model, test=Chi) Error in if (dispersion == 1) Inf else

Re: [R] box plot

2009-10-05 Thread David Winsemius
On Oct 5, 2009, at 12:47 PM, Henrique Dallazuanna wrote: See family argument in ?par: par(family = 'serif') boxplot(rnorm(100), main = 'Title of Boxplot') On Mon, Oct 5, 2009 at 11:48 AM, kayj kjaj...@yahoo.com wrote: Hi All, I was wondering if if it is possible to change the font style

Re: [R] How to plot a Quadratic Model?

2009-10-05 Thread Kingsford Jones
see ?curve e.g. qftn - function(x) 1 + 2*x - .1*x^2 curve(qftn, 0, 10) hth, Kingsford On Mon, Oct 5, 2009 at 9:42 AM, Juliano van Melis jvme...@gmail.com wrote: Good day for all, I'm a beginner aRgonaut, thus I'm having a problem to plot a quadratic model of regression in a plot. First I

Re: [R] nls not accepting control parameter?

2009-10-05 Thread Peter Ehlers
Hi Rainer, Sorry, I hadn't read your post quite carefully enough. The problem appears to be with SSlogis. It seems that control parameters are not being passed through SSlogis. If you specify a start vector, minFactor can be set. nls( y ~ Asym/(1+exp((xmid-x)/scal)), data = dat,

Re: [R] Apply R in Excel through RExcel

2009-10-05 Thread Felipe Carrillo
ryusuke: It sounds like you need to have (D)COM server to be able to work on the background. As for the foreground, rcom is what you need and it appears to be working OK. I am out of my office right now but I'll back to work next week and I will be able to explain in more detail how the

Re: [R] interpreting glmer results

2009-10-05 Thread Kingsford Jones
On Mon, Oct 5, 2009 at 8:52 AM, Umesh Srinivasan umesh.sriniva...@gmail.com wrote: Hi all, [snip] Fixed effects:             Estimate Std. Error z value Pr(|z|) (Intercept) -138.8423     0.4704  -295.1   2e-16 *** SpeciesCr     -0.9977     0.6259    -1.6  0.11091 SpeciesDb     -1.2140    

Re: [R] Ubuntu, Revolutions, R

2009-10-05 Thread Ista Zahn
I'm a fellow (K)Ubuntu user, although I'm waiting for KK to be released before upgrading. I just wanted to point out that presumably this advertisement can be avoided by installing R as instructed at http://cran.r-project.org/bin/linux/ubuntu/ rather than using Ubuntu's version. I usually do this

Re: [R] interpreting glmer results

2009-10-05 Thread Bert Gunter
Comment at end Below. Bert Gunter Genentech Nonclinical Biostatistics -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Kingsford Jones Sent: Monday, October 05, 2009 10:30 AM To: Umesh Srinivasan Cc: r-help Subject: Re: [R]

Re: [R] Ubuntu, Revolutions, R

2009-10-05 Thread Andy Choens
On Monday 05 October 2009 09:38:21 am David M Smith wrote: Andrew is correct: the upcoming release of Ubuntu (Karmic Koala) will feature the REvolution R distribution. (I am a REvolution Computing employee.) Our developers have been working with Canonical's representatives over the past

[R] boundary situation that caught me by surprise

2009-10-05 Thread RICHARD M. HEIBERGER
tmp2 - matrix(1:8,4,2) dimnames(tmp2) NULL tmp2 [,1] [,2] [1,]15 [2,]26 [3,]37 [4,]48 dimnames(tmp2)[[2]] - c(a,b) tmp2 a b [1,] 1 5 [2,] 2 6 [3,] 3 7 [4,] 4 8 tmp1 - matrix(1:4,4,1) dimnames(tmp1) NULL tmp1 [,1] [1,]1 [2,]2 [3,]3

Re: [R] interpreting glmer results

2009-10-05 Thread Kingsford Jones
On Mon, Oct 5, 2009 at 11:57 AM, Bert Gunter gunter.ber...@gene.com wrote: [snip] -- ... and if the correlations are high it tells you that your model may be near unidentifiable = the model parameters may not be effectively estimated from the data. To understand what high, near and effectively

[R] how to have 'match' ignore no-matches

2009-10-05 Thread Jill Hollenbach
Hi all, I think this is a very basic question, but I'm new to this so please bear with me. I'm using match to translate elements of a data frame using a lookup table. If the content of a particular cell is not found in the lookup table, the function returns NA. I'm wondering how I can just

[R] Visualizing some data

2009-10-05 Thread sverre
Hi all, I have an easy data set. It has three columns: Subject, Condition, dprime. A small excerpt follows, in order to illustrate: Subject Condition dprime HY s 3.725846 CM s 2.877658 EH s 5 HY st 2.783553 CM st 2.633955 EH st

Re: [R] how to have 'match' ignore no-matches

2009-10-05 Thread David Winsemius
On Oct 5, 2009, at 4:01 PM, Jill Hollenbach wrote: Hi all, I think this is a very basic question, but I'm new to this so please bear with me. I'm using match to translate elements of a data frame using a lookup table. If the content of a particular cell is not found in the lookup

Re: [R] how to have 'match' ignore no-matches

2009-10-05 Thread Rolf Turner
On 6/10/2009, at 9:01 AM, Jill Hollenbach wrote: Hi all, I think this is a very basic question, but I'm new to this so please bear with me. I'm using match to translate elements of a data frame using a lookup table. If the content of a particular cell is not found in the lookup table,

Re: [R] how to have 'match' ignore no-matches

2009-10-05 Thread Jill Hollenbach
Let me clarify: I'm using this-- dfnew- sapply(df, function(df) lookuptable[match(df, lookuptable [ ,1]), 2]) lookup 0101 01:01 0201 02:01 0301 03:01 0401 04:01 df 0101 0301 0201 0401 0101 0502 dfnew 01:01 03:01 02:01 04:01 01:01 NA but what I want is: dfnew2 01:01

[R] 3D polar plots

2009-10-05 Thread Shane B.
Hello, I am very new to R. I would like to plot astronomy data by right ascension, declination, and various distance values, such as redshift and comoving distance, in 3D. Is there any 3D polar plotting functions? I can't seam to locate any information on whether it exists or not.

Re: [R] GLM quasipoisson error

2009-10-05 Thread Ben Bolker
atorso wrote: Hello, I'm having an error when trying to fit the next GLM: model-glm(response ~ CLONE_M + CLONE_F + HATCHING +(CLONE_M*CLONE_F) + (CLONE_M*HATCHING) + (CLONE_F*HATCHING) + (CLONE_M*CLONE_F*HATCHING), family=quasipoisson) anova(model, test=Chi) Error in if (dispersion

Re: [R] 3D polar plots

2009-10-05 Thread David Winsemius
Searching on spherical coordinates brings up quite a few hits in r- search: Try: http://search.r-project.org/cgi-bin/namazu.cgi?query=%22spherical+coordinates%22max=100result=normalsort=scoreidxname=functionsidxname=Rhelp08idxname=viewsidxname=Rhelp02 The most relevant appears to be:

Re: [R] Visualizing some data

2009-10-05 Thread Bert Gunter
See http://addictedtor.free.fr/graphiques/ for many examples with code. Bert Gunter Genentech Nonclinical Biostatistics -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of sverre Sent: Monday, October 05, 2009 1:13 PM To:

Re: [R] how to have 'match' ignore no-matches

2009-10-05 Thread David Winsemius
On Oct 5, 2009, at 4:47 PM, Jill Hollenbach wrote: Let me clarify: I'm using this-- dfnew- sapply(df, function(df) lookuptable[match(df, lookuptable [ , 1]), 2]) It seems a very bad idea to use the same name in your functions as that of the dataframe argument you might be passing. You

[R] Date-Time-Stamp input method for user-specific formats

2009-10-05 Thread esp
Date-Time-Stamp input method to correctly interpret user-specific formats:coding is 90% there - based on exmple at http://tolstoy.newcastle.edu.au/R/help/05/02/12003.html ...anyone got the last 10% please? CONTEXT: Data is received where one of the columns is a datetimestamp. At midnight,

Re: [R] Date-Time-Stamp input method for user-specific formats

2009-10-05 Thread Don MacQueen
Off the top of my head, I think you're working to hard at this. I would read in the timestamp column as a character string. Then, find those where the string length is too short [using nchar()], append 00:00:00 to those [using paste()], and then convert to POSIXt [using as.POSIXct()]. No

Re: [R] Date-Time-Stamp input method for user-specific formats

2009-10-05 Thread David Winsemius
On Oct 5, 2009, at 5:14 PM, esp wrote: Date-Time-Stamp input method to correctly interpret user-specific formats:coding is 90% there - based on exmple at http://tolstoy.newcastle.edu.au/R/help/05/02/12003.html ...anyone got the last 10% please? CONTEXT: Data is received where one of the

Re: [R] Date-Time-Stamp input method for user-specific formats

2009-10-05 Thread Gabor Grothendieck
Try this. First we read a line at a time into L except for the header. Then we use strapply to match on the given pattern. It passes the backreferences (the portions within parentheses in the pattern) to the function (defined via a formula) whose implicit arguments are x, y and z. That

[R] Loop function/comparison operator problem

2009-10-05 Thread jimdare
Hi There, I have created the following function format- function(){ repeat { form-readline(paste(\nIn what format do you want to save these plots?\nChoose from: wmf, emf, png, jpg, jpeg, bmp, tif, tiff, ps, eps, or pdf.\nNote: eps is the suggested format for publication quality plots.\nPlot

Re: [R] gsub - replace multiple occurences with different strings

2009-10-05 Thread Gabor Grothendieck
Here are two approaching using Bill's sample data: 1. gsubfn supports proto objects whose methods have access to a count variable that is built into gsubfn and automatically reset to zero at the start of each string so you can do this (gsubfn uses proto internally so you don't have to explicitly

Re: [R] Loop function/comparison operator problem

2009-10-05 Thread jim holtman
use %in% instead of '==' On Mon, Oct 5, 2009 at 7:47 PM, jimdare jamesdar...@gmail.com wrote: Hi There, I have created the following function format- function(){ repeat { form-readline(paste(\nIn what format do you want to save these plots?\nChoose from: wmf, emf, png, jpg, jpeg, bmp,

Re: [R] Loop function/comparison operator problem

2009-10-05 Thread Duncan Murdoch
On 05/10/2009 7:47 PM, jimdare wrote: Hi There, I have created the following function format- function(){ repeat { form-readline(paste(\nIn what format do you want to save these plots?\nChoose from: wmf, emf, png, jpg, jpeg, bmp, tif, tiff, ps, eps, or pdf.\nNote: eps is the suggested format

Re: [R] Vim-R-plugin (new version)

2009-10-05 Thread Gabor Grothendieck
Looks interesting. Could you make a vimball out of it to facilitate installation. On Mon, Oct 5, 2009 at 10:12 AM, Jakson A. Aquino jaksonaqu...@gmail.com wrote: Dear R users, The author of Tinn-R (Jose Claudio Faria) now is co-author of Vim-R-plugin2, a plugin that makes it possible to

Re: [R] how to have 'match' ignore no-matches

2009-10-05 Thread Tony Plate
x - data.frame(d=letters[1:3], e=letters[3:5]) lookuptable - c(a=aa, c=cc, e=ee) match.or.keep - function(x, lookuptable) {if (is.factor(x)) x - as.character(x); m - match(x, names(lookuptable)); ifelse(is.na(m), x, lookuptable[m])} # to return a matrix apply(x, 2, match.or.keep,

[R] ggplot2 applying a function based on facet

2009-10-05 Thread stephen sefick
Look at the bottom of the message for my question #here is a little function that I wrote USGS - function(input=discharge, days=7){ library(chron) library(gsubfn) #021973269 is the Waynesboro Gauge on the Savannah River Proper (SRS) #02102908 is the Flat Creek Gauge (ftbrfcms) #02133500 is the

Re: [R] ggplot2 applying a function based on facet

2009-10-05 Thread David Winsemius
On Oct 5, 2009, at 9:39 PM, stephen sefick wrote: Look at the bottom of the message for my question #here is a little function that I wrote USGS - function(input=discharge, days=7){ library(chron) library(gsubfn) #021973269 is the Waynesboro Gauge on the Savannah River Proper (SRS) #02102908

Re: [R] Vim-R-plugin (new version)

2009-10-05 Thread Jakson A. Aquino
On Mon, Oct 05, 2009 at 08:03:23PM -0400, Gabor Grothendieck wrote: Looks interesting. Could you make a vimball out of it to facilitate installation. It seems that VimBall is capable of creating vimballs of simple plugins which have a file at ftplugin and a another at doc. The Vim-R-plugin

[R] how to fit time varying coefficient regression model?

2009-10-05 Thread R_help Help
Hi - I read through dse package manual a bit. I'm not quite certain how I can use it to estimate a time varying coefficient regression model? I might pick up an inappropriate package. Any suggestion would be greatly appreciated. Thank you. rh __

Re: [R] ggplot2 applying a function based on facet

2009-10-05 Thread stephen sefick
Sorry, I want the cumsum of precipitation by gauge name. that can then be used with the appropriate datetime stamp to pot a cumulative rainfall plot. On Mon, Oct 5, 2009 at 9:03 PM, David Winsemius dwinsem...@comcast.net wrote: On Oct 5, 2009, at 9:39 PM, stephen sefick wrote: Look at the

[R] R on Linux, and R on Windows , any difference in maturity+stability?

2009-10-05 Thread Robert Wilkins
Will R have more glitches on one operating system as opposed to another, or is it pretty much the same? robert __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

[R] taking limit

2009-10-05 Thread dahuang
hey, i wonder how to perform limit in R. In R help, i find the function lim, but it seems i need to load package first, can anyone tell me which one? Or ANY method of taking limit, i searched it for 2 days but i failed, thanx~~ -- View this message in context:

Re: [R] ggplot2 applying a function based on facet

2009-10-05 Thread David Winsemius
On Oct 5, 2009, at 10:45 PM, stephen sefick wrote: Sorry, I want the cumsum of precipitation by gauge name. that can then be used with the appropriate datetime stamp to pot a cumulative rainfall plot. I dunno. Here is what I get when I extract the data-gathering part of that extended

Re: [R] taking limit

2009-10-05 Thread David Winsemius
This is a rather vague question, ... I hope you will agree? Are you asking for some approach that does symbolic calculus? Perhaps package Ryacas? On Oct 5, 2009, at 9:07 PM, dahuang wrote: hey, i wonder how to perform limit in R. In R help, i find the function lim, but it seems i need

[R] Problem with na.omit when using length()

2009-10-05 Thread Viju Moses
I'm seeing what looks to me like odd behaviour when I use na.omit on a simple length function, as follows. sno [1] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 a [1] 0 1 0 0 1 1 0 0 0 0 0 0 0 0 1 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0

Re: [R] Problem with na.omit when using length()

2009-10-05 Thread Daniel Malter
This looks buggish to me (though at least non-intuitive), but I am almost sure there is an explanation for why the b==0 condition includes the NAs. You find a way to circumvent it in the last two lines of the example below. a=c(1,1,1,0,0,0) b=c(1,NA,0,1,NA,0) sno=rnorm(6) na.omit(length(sno[a==1

Re: [R] Problem with na.omit when using length()

2009-10-05 Thread Yihui Xie
just put na.omit() inside length() if you intend to omit the NA elements of the vector (otherwise you are trying to omit the NA's of the returned value of length() which is a scalar 2): length(na.omit(sno[a==1 b==0])) Regards, Yihui -- Yihui Xie xieyi...@gmail.com Phone: 515-294-6609 Web:

Re: [R] Problem with na.omit when using length()

2009-10-05 Thread Viju Moses
Thanks for that. It works as expected now. A case of GIGO (garbage in- garbage out) on my part, with some head-banging. :-) Regards Viju Moses Yihui Xie wrote: just put na.omit() inside length() if you intend to omit the NA elements of the vector (otherwise you are trying to omit the NA's of