[R] Dataframe to word, using R2wd

2010-05-14 Thread Jeremy Miles
Hi All, I'm trying to use R2wd to send a dataframe to Word. The dataframe isn't huge - 300 rows, 12 variables, although it has some long strings in it. Using: wdTable(format(myDataFrame)) or wdTable(myDataFrame) Produces a very complex table, which Word struggles to process and layout. (I c

Re: [R] plot formula 'x' is missing?

2010-05-14 Thread Giovanni Azua
Hi Jorge and Dennis, Thank you for the hint! However, I'm still very intrigued as to why it does not work using plot ... what is special about this specific formula that plot doesn't like it? Best regards, Giovanni On May 15, 2010, at 7:12 AM, Jorge Ivan Velez wrote: > Hi Giovanni, > > curve

[R] Categorical Predictors for SVM (e1071)

2010-05-14 Thread Vanilla Sky
Dear all, I have a question about using categorical predictors for SVM, using "svm" from library(e1071). If I have multiple categorical predictors, should they just be included as factors? Take a simple artificial data example: x1<-rnorm(500) x2<-rnorm(500) #Categorical Predictor 1, with 5 level

Re: [R] plot formula 'x' is missing?

2010-05-14 Thread Jorge Ivan Velez
Hi Giovanni, curve(1/(1+exp(5.0993-0.1084*x)), 0, 100) HTH, Jorge On Sat, May 15, 2010 at 12:43 AM, Giovanni Azua <> wrote: > Hello, > > I'd like to plot the logistic function for a specific model like this: > > > > plot(formula=y~1/(1+exp(5.0993-0.1084*x)),data=data.frame(x=seq(0,100,length.o

[R] plot formula 'x' is missing?

2010-05-14 Thread Giovanni Azua
Hello, I'd like to plot the logistic function for a specific model like this: > plot(formula=y~1/(1+exp(5.0993-0.1084*x)),data=data.frame(x=seq(0,100,length.out=1000))) Error in is.function(x) : 'x' is missing However, I get the 'x' is missing error above and don't know how to fix it ... Can a

Re: [R] Simple question on binning data

2010-05-14 Thread Frank E Harrell Jr
On 05/14/2010 07:35 PM, kMan wrote: Wow! This definitely contributed to my evening. If you could indulge, I would like some clarification on this matter of binning and distortion, particularly wrt time series (perhaps related to long-memory processes?). I had thought binning was standard practic

Re: [R] Simple question on binning data

2010-05-14 Thread kMan
Wow! This definitely contributed to my evening. If you could indulge, I would like some clarification on this matter of binning and distortion, particularly wrt time series (perhaps related to long-memory processes?). I had thought binning was standard practice in spectral analysis and ANPOW. ..

Re: [R] Are there better ways to save and restore par() settings

2010-05-14 Thread Bert Gunter
Perhaps a bit of additional explanation might help. 1. This is obviously for functions that others might use, as one is free to inflict punishment on oneself. The idea is not to alter the innocent user's graphical settings. 2. on.exit() is preferred in case an error is encountered and the functio

Re: [R] Are there better ways to save and restore par() settings

2010-05-14 Thread Duncan Murdoch
On 14/05/2010 6:19 PM, David Winsemius wrote: On May 14, 2010, at 5:45 PM, Duncan Murdoch wrote: On 14/05/2010 3:51 PM, David Winsemius wrote: Some of the help page examples use the form: opar <- par() .plotting activities... par(opar) This seems to "work" well, yet I have re

Re: [R] Strange behavior when plotting with ggplot2 and lattice

2010-05-14 Thread David Winsemius
On May 14, 2010, at 7:21 PM, Ralf B wrote: Hi all, I have the following script,which won't plot (tried in RGUI and also in Eclipse StatET): library(ggplot2)# for plotting results userids <- c(1,2,3) for (userid in userids){ qplot(c(1:10), c(1:20)) } print ("end") No plot show

[R] Strange behavior when plotting with ggplot2 and lattice

2010-05-14 Thread Ralf B
Hi all, I have the following script,which won't plot (tried in RGUI and also in Eclipse StatET): library(ggplot2)# for plotting results userids <- c(1,2,3) for (userid in userids){ qplot(c(1:10), c(1:20)) } print ("end") No plot shows up. If I run the following: library(ggplot2)

Re: [R] operations between two aggregated data frames?

2010-05-14 Thread Gabor Grothendieck
And here is a pure R solution: > m <- merge(df1, df2, by = "category") > m$datediff <- m$date.x - m$date.y > m <- m[order(m$category, m$date.x, m$date.y), ] > m category A.x date.x A.y date.y datediff 2 1 124 2003-02-08 28 2003-05-17 -98 days 1 1 124 2003-02-08 116

Re: [R] operations between two aggregated data frames?

2010-05-14 Thread Gabor Grothendieck
Generating df1 and df2 as in your post try this (and see http://sqldf.googlecode.com for more info): > library(sqldf) > out <- sqldf("select category, + df1.date date1, + df2.date date2, + df1.date - df2.date datediff + from df1 join df2 using(category) + order by category, date1, date2") > > out[

Re: [R] operations between two aggregated data frames?

2010-05-14 Thread Phil Spector
Jonathan- When you provide an example that uses sample() or random number generators, it's a good idea to call set.seed() before generating the data, so that others can reproduce it. But to answer your question: mapply(function(d1,d2)outer(d1$date,d2$date,'-'), split(df1,df1$ca

[R] twos complement / Hex data

2010-05-14 Thread Oliver
Hello, is there a package for reading in Hex-Data and calculating vlaues into twos complement and back to normal integer values? Oliver __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guid

Re: [R] Are there better ways to save and restore par() settings

2010-05-14 Thread David Winsemius
On May 14, 2010, at 5:45 PM, Duncan Murdoch wrote: On 14/05/2010 3:51 PM, David Winsemius wrote: Some of the help page examples use the form: opar <- par() .plotting activities... par(opar) This seems to "work" well, yet I have read in some places Please include commented, retrieva

[R] operations between two aggregated data frames?

2010-05-14 Thread Jonathan
Hi All, I've come up with a solution for this problem that relies on a for loop, and I was wondering if anybody had any insight into a more elegant method: I have two data frames, each has a column for categorical data and a column for date. What I'd like to do, ideally, is calculate the numbe

Re: [R] What does this warning mean: "DLL attempted to change FPU control word from 8001f to 9001f"

2010-05-14 Thread Duncan Murdoch
On 14/05/2010 5:00 PM, Ted Byers wrote: I started a brand new session in R 2.10.1 (on Windows). If it matters, I am running the community edition of MySQL 5.0.67, and it is all running fine. I am just beginning to examine the process of getting timer series data from one table in MySQL, computin

Re: [R] Are there better ways to save and restore par() settings

2010-05-14 Thread Duncan Murdoch
On 14/05/2010 3:51 PM, David Winsemius wrote: Some of the help page examples use the form: opar <- par() .plotting activities... par(opar) This seems to "work" well, yet I have read in some places Please include commented, retrievalbe citations for "some places". that it is not th

[R] What does this warning mean: "DLL attempted to change FPU control word from 8001f to 9001f"

2010-05-14 Thread Ted Byers
I started a brand new session in R 2.10.1 (on Windows). If it matters, I am running the community edition of MySQL 5.0.67, and it is all running fine. I am just beginning to examine the process of getting timer series data from one table in MySQL, computing moving averages and computing a selectio

[R] Categorical Predictors for SVM (e1071)

2010-05-14 Thread Vanilla Sky
Dear all, I have a question about using categorical predictors for SVM, using "svm" from library(e1071). If I have multiple categorical predictors, should they just be included as factors? Take a simple artificial data example: x1<-rnorm(500) x2<-rnorm(500) #Categorical Predictor 1, with 5 level

Re: [R] Fwd: nonlinearity and interaction

2010-05-14 Thread William Simpson
On Fri, May 14, 2010 at 5:54 PM, Bert Gunter wrote: > 1. As this is not an R question, this is probably not an appropriate list > for posting. You might wish to consider a list specifically devoted to > statistics and data analysis. > > Well I think it is an R question to the extent that I'm usin

Re: [R] "rpart": how to use each variable only once?

2010-05-14 Thread Shi, Tao
This is just one single decision tree, not forest. If you're asking what package I use to construct one single tree, it's 'rpart'. > >From: Changbin Du >To: "Shi, Tao" >Cc: r-help@r-project.org >Sent: Fri, May 14, 2010 12:35:20 PM >Subject: Re: [R] "rpart": how to use each variable only once

Re: [R] multhist,labels and percentages

2010-05-14 Thread Peter Ehlers
Federico, Yes, do use axis(2, at = whatever, labels = whateverelse) for one axis. Then use axis(4, ...) for the other axis. You may need to use par('usr') to determine the y-extent of the plot. -Peter Ehlers On 2010-05-14 11:50, Federico Calboli wrote: On 14 May 2010, at 18:25, Thomas Stewart

[R] Are there better ways to save and restore par() settings

2010-05-14 Thread David Winsemius
Some of the help page examples use the form: opar <- par() .plotting activities... par(opar) This seems to "work" well, yet I have read in some places that it is not the preferred method to keep you parameters from getting corrupted. What is the preferred method? A worked example f

Re: [R] How to draw a graphic using data with coordinates and production rate?

2010-05-14 Thread Daniel Malter
Oh, if plot does the thing, then you just want to specify the color argument accordingly, where the color argument is given by your production figure. x=seq(1:100) y=seq(1:100) x.coord=sample(x,100) y.coord=sample(y,100) production=sample(1:100, 100) plot(y.coord~x.coord) #now lets say we wan

Re: [R] Plotting legend outside of multiple panels

2010-05-14 Thread John Poulsen
Patrick, Thanks for the tip below. It took me awhile to get to it, but your solution worked great. In case it is useful for other people, below is a very simple example where I create two plots side by side with the legend centered on top. John ## Example plot for R server par(mar=c

[R] help color coding map in R

2010-05-14 Thread Anderson, Chris
I am trying to create a map with selected states based on highest to lowest mean cost. The following code properly selects the correct states, and the legend is properly color coded with ranges, but the colors per range does not match the state colors. I need help getting the state colors to mat

Re: [R] tune svm

2010-05-14 Thread jparga
Steve, Thanks a lot for your answer. I haven´t tried to deal with the situation yet, cause I had a field trip. I'll let you know if I can solve my problem with your observation. Bye, Juan P. Argañaraz Lic. en Ecología y Cons. del Ambiente Instituto de Hidrología de Llanuras CC 44 (B7300

Re: [R] "rpart": how to use each variable only once?

2010-05-14 Thread Changbin Du
is this random decision tree, I dont know is there any package can run it. If you know, please let me know. On Fri, May 14, 2010 at 10:23 AM, Shi, Tao wrote: > Hi list, > > Is there a way in "rpart" to force the variables only used once when doing > the splits? > > This is how the question cam

Re: [R] Deleting rows with NA from isolated column in matrix

2010-05-14 Thread Dennis Murphy
x[!is.na(x[, 3]), ] HTH, Dennis On Fri, May 14, 2010 at 12:16 PM, Ryan Utz wrote: > Hi all, > > I'm relatively new to R and have a data management problem. I am importing > a > data matrix with some columns that have missing values. I am trying to > figure out how to delete rows with NA for dat

Re: [R] Deleting rows with NA from isolated column in matrix

2010-05-14 Thread Jorge Ivan Velez
Hi Ryan, How about this? x[!is.na(x[,3]),] HTH, Jorge On Fri, May 14, 2010 at 3:16 PM, Ryan Utz <> wrote: > Hi all, > > I'm relatively new to R and have a data management problem. I am importing > a > data matrix with some columns that have missing values. I am trying to > figure out how to d

[R] Deleting rows with NA from isolated column in matrix

2010-05-14 Thread Ryan Utz
Hi all, I'm relatively new to R and have a data management problem. I am importing a data matrix with some columns that have missing values. I am trying to figure out how to delete rows with NA for data FOR JUST ONE SPECIFIED column. For instance, with the example matrix: x<-matrix(nrow=5,ncol=3)

Re: [R] plot with no default axis labels

2010-05-14 Thread Giovanni Azua
Hello Jim, Very nice example! thank you! Best regards, Giovanni On May 14, 2010, at 11:50 AM, Jim Lemon wrote: > On 05/14/2010 07:31 PM, Giovanni Azua wrote: >> Hello, >> >> I could not find an easy way to have the plot function not display the >> default x and y-axis labels, I would like to

Re: [R] Cubic B-spline, how to numerically integrate?

2010-05-14 Thread Frank E Harrell Jr
On 05/14/2010 11:36 AM, David Winsemius wrote: On May 14, 2010, at 11:57 AM, David Winsemius wrote: On May 14, 2010, at 11:41 AM, Claudia Penaloza wrote: (corrected version of previous posting) I fit a GAM to turtle growth data following methods in Limpus & Chaloupka 1997 (http://www.int-r

Re: [R] color lines by group membership in spaghetti plot

2010-05-14 Thread Dennis Murphy
Hi: Here's an example from the ggplot2 package using the Orthodont data from Pinheiro & Bates (2000): library(nlme) library(ggplot2) p <- ggplot(data = Orthodont, aes(x = age, y = distance, group = Subject, colour = Sex)) p + geom_line() ?Orthodont will give you some

Re: [R] Multiple plots; single x(y) labels

2010-05-14 Thread Shi, Tao
ha, I was focusing on the wrong thing! Sorry, Gurmeet. Good job! > >From: Xin Ge >To: "Shi, Tao" >Cc: Gurmeet ; Jim Lemon ; >r-help@r-project.org >Sent: Fri, May 14, 2010 10:51:26 AM >Subject: Re: [R] Multiple plots; single x(y) labels > > >Thank you all for your replies. > > >@Tao: Actua

Re: [R] Boxplots in R

2010-05-14 Thread Gavin Simpson
On Fri, 2010-05-14 at 09:31 -0700, Angelica wrote: > Hello, > I need to make some boxplots, but I only have the stats and not all the > data. Is there any function or command that I could use? > > Thanks, > Angelica, ?bxp See ?boxplot and the object returned by boxplot from one of the exampl

Re: [R] R version of SAS/IntrNet

2010-05-14 Thread Carlos J. Gil Bellosta
I would recommend Rapache. I have tested it and it works great. SAS/Intrnet is just CGI with another name. Best regards, Carlos J. Gil Bellosta http://www.datanalytics.com On 05/12/2010 06:27 PM, Mark Lamias wrote: Does an R package exist that is similar to SAS/Intrnet (http://support.sas.c

Re: [R] Whiskers on the default boxplot {graphics}

2010-05-14 Thread Peter Ehlers
Just to put this topic to rest: The hinges match quantile(x, probs = c(1,3)/4, type = 2) except when n = 3 mod 4. I no longer have Tukey's EDA book, but I think that his idea was that hinges (aka quartiles) were defined as medians of the lower/upper halves of the (sorted, of course) data, where

Re: [R] Fwd: Fwd: nonlinearity and interaction

2010-05-14 Thread Duncan Murdoch
On 14/05/2010 11:57 AM, William Simpson wrote: Thanks for telling me. Sorry. Don't know why my posts are not showing up here at gmail. Never happened before. Thought they had been lost in the aether. I believe Gmail will mark them as sent, and recognize them when they arrive, and not store

Re: [R] Multiple plots; single x(y) labels

2010-05-14 Thread Xin Ge
Thank you all for your replies. @Tao: Actually Gurmeet's solution is the one I was looking for, below is a chunk from my last email: * Like for example, the following plot has a *combine* x-label ("Height") and one y-label ("Weight") http://support.sas.com/documentati

Re: [R] R cannot access the web?

2010-05-14 Thread Trojan
I am sorry guys neither of those things have worked! I am at an absolute loss! I did contact the HPC server managers to see if they are willing to update the version of R that's accessible to us - but I am not sure if or when they will make the changes. -- View this message in context: http:/

Re: [R] multhist,labels and percentages

2010-05-14 Thread Federico Calboli
On 14 May 2010, at 18:25, Thomas Stewart wrote: > First, why doesn't the following code work? What exactly is the error you > are getting? > > par(mfrow=c(1,2)) > pop1<-rnorm(100) > hist(pop1,freq=F,ylim=c(0,1)) > pop2<-rgamma(100,1,1) > hist(pop2,freq=F,ylim=c(0,1)) Let's define 'work'. The

[R] problem with geepack::geese() argument "soffset"

2010-05-14 Thread Tom Price
I get an error message when trying to specify a scale offset using geese() in library(geepack). Here is a dummy example: v <- rep( 1:2, each = 100 ) x <- rnorm( 200 ) * sqrt( v ) i <- 1:200 summary( geese( x~1, id=i ) ) # works ok summary( geese( x~1, id=i, soffset=v ) ) # fails Error in geese.fi

[R] problem with subscription

2010-05-14 Thread Vanilla Sky
Hello, I've been trying to become a subscriber to the R-help mail list, using this email ID (skies.vani...@gmail.com), but it hasn't been working. As a result, I am not able to post questions directly. I filled out the form twice at https://stat.ethz.ch/mailman/listinfo/r-help, over 2 days, but di

[R] Categorical Predictors for SVM (e1071)

2010-05-14 Thread Vanilla Sky
Dear all, I have a question about using categorical predictors for SVM, using "svm" from library(e1071). If I have multiple categorical predictors, should they just be included as factors? Take a simple artificial data example: x1<-rnorm(500) x2<-rnorm(500) #Categorical Predictor 1, with 5 level

[R] Error in eco-model

2010-05-14 Thread roelvhoolst
Hello, I am working on a paper of ecological modelling in R. I have made a Lotka Volterra model for tree animal species. I was trying to get the model in R but there are some errors. Since i am not so experienced with R i can't find the bugs in my script. I hope if there is someone who can help m

Re: [R] Problem with vignette printing

2010-05-14 Thread Sébastien Bihorel
Yes, I have installed R through opensuse's package installer. Is ?Startup the correct place to look at about environment variables or is there a more appropriate help page? On Fri, May 14, 2010 at 10:00 AM, Prof Brian Ripley wrote: > On Fri, 14 May 2010, Sébastien Bihorel wrote: > > Hi Duncan,

[R] multivariate Granger causality

2010-05-14 Thread Elena Khramtsova
Hi, I have a time series vector of 5 variables: a, b, c, d, and e. I would like to test if (a and b) Granger cause c. I want to keep d and e in the VAR model. Is there a preprogrammed way to do it? The causality function in the vars package allows to test whether (a and b) cause the rest of th

Re: [R] Putting 6 graphs on one page

2010-05-14 Thread Shi, Tao
Without the actual data, it's hard to see what's going on here, but It seems you have to restructure your data object to a "long" table, then it should be easy to use 'dotplot' to generate your plots. ...Tao - Original Message > From: Dimitri Liakhovitski > To: r-help@r-project.org

[R] correlation pulses of concentration and biological responses

2010-05-14 Thread Chloe
Dear all, I would like to estimate the correlation between concentration and biological response, but the correlation is not linear as concentration increases gradually along time with 3 peaks of concentration and response increases as well but less quickly and with three decreasing peaks correspo

[R] Boxplots in R

2010-05-14 Thread Angelica
Hello, I need to make some boxplots, but I only have the stats and not all the data. Is there any function or command that I could use? Thanks, Angelica, -- View this message in context: http://r.789695.n4.nabble.com/Boxplots-in-R-tp2216852p2216852.html Sent from the R help mailing list arc

Re: [R] Multiple plots; single x(y) labels

2010-05-14 Thread Shi, Tao
Gurmeet, I think Xin is more interested in the common axes, rather than just one single xlab or ylab. Jim's solution is much more fancier than mine :-) ...Tao - Original Message > From: Gurmeet > To: Jim Lemon > Cc: r-help@r-project.org > Sent: Fri, May 14, 2010 10:00:03 AM > Sub

Re: [R] multhist,labels and percentages

2010-05-14 Thread Thomas Stewart
First, why doesn't the following code work? What exactly is the error you are getting? par(mfrow=c(1,2)) pop1<-rnorm(100) hist(pop1,freq=F,ylim=c(0,1)) pop2<-rgamma(100,1,1) hist(pop2,freq=F,ylim=c(0,1)) Second, help.search("multihist") returned the multi.hist function. Is multi.hist [instead o

[R] "rpart": how to use each variable only once?

2010-05-14 Thread Shi, Tao
Hi list, Is there a way in "rpart" to force the variables only used once when doing the splits? This is how the question came about. Often time, the tree constructed uses the same variable (say X1) for the first and second splits, for example. However, due to practical reason, the researcher

[R] Putting 6 graphs on one page

2010-05-14 Thread Dimitri Liakhovitski
Apologies, if it's a very simple question, but I am really not very good with trellis. I have a piece of a code (below) that works just fine and builds 6 graphs - in a loop. I loop through 6 conditions and build one graph for each. What would be the most efficient way of creating one page with 6 gr

Re: [R] Problem with vignette printing

2010-05-14 Thread Sébastien Bihorel
Ok, Solved the problem by editing my Renviron file in /usr/lib/R/etc. Thanks everyone for your help. On Fri, May 14, 2010 at 11:48 AM, Prof Brian Ripley wrote: > On Fri, 14 May 2010, Sébastien Bihorel wrote: > > Yes, I have installed R through opensuse's package installer. Is ?Startup >> the c

Re: [R] Multiple plots; single x(y) labels

2010-05-14 Thread Gurmeet
Hi Xin, Or, just try adding "oma" and "mtext" commands: ?par ?mtext # Code par(mfcol=c(2,2)) par(oma=c(2,2,0,0)) plot(x <- sort(rnorm(7)), type = "s", main = "", ylab="", xlab="") plot(x <- sort(rnorm(27)), type = "s", main = "", ylab="", xlab="") plot(x <- sort(rnorm(47)), type = "s", main = ""

Re: [R] Fwd: nonlinearity and interaction

2010-05-14 Thread Bert Gunter
1. As this is not an R question, this is probably not an appropriate list for posting. You might wish to consider a list specifically devoted to statistics and data analysis. 2. Having said that, some kind souls on this list may be willing to help. 3. I believe you have the wrong data structure a

[R] color lines by group membership in spaghetti plot

2010-05-14 Thread Jack Monpas-Huber
Greetings, I am new to R. Right now I'm most interested in the spaghetti plots of achievement over time by student ID associated with longitudinal analysis. How can I do a spaghetti plot of all students, but color the lines by group membership such as gender or race, and indicate this color sche

Re: [R] finding the plot limits generated by default

2010-05-14 Thread Justin Fincher
That worked! Thank you again for your help. - Fincher On Fri, May 14, 2010 at 12:33, Marc Schwartz wrote: > Justin, > > Try something like this: > > par(mfrow = c(2, 1)) > > drawGffPlots2(data1, data2, trackingDye = TRUE, > slice = "chr13", newDev = 0) > > plot(densities_subset$V

Re: [R] Cubic B-spline, how to numerically integrate?

2010-05-14 Thread David Winsemius
On May 14, 2010, at 11:57 AM, David Winsemius wrote: On May 14, 2010, at 11:41 AM, Claudia Penaloza wrote: (corrected version of previous posting) I fit a GAM to turtle growth data following methods in Limpus & Chaloupka 1997 (http://www.int-res.com/articles/meps/149/m149p023.pdf). I wa

Re: [R] Cubic B-spline, how to numerically integrate?

2010-05-14 Thread Robert A LaBudde
It's a piecewise cubic function. All you need are the knots and the coefficients. You can then right down the analytic formula for the integral. It doesn't need to be numerically integrated. At 11:57 AM 5/14/2010, David Winsemius wrote: On May 14, 2010, at 11:41 AM, Claudia Penaloza wrote:

Re: [R] finding the plot limits generated by default

2010-05-14 Thread Marc Schwartz
Justin, Try something like this: par(mfrow = c(2, 1)) drawGffPlots2(data1, data2, trackingDye = TRUE, slice = "chr13", newDev = 0) plot(densities_subset$V4, densities_subset$V6, type = "h", xlim = par("usr")[1:2], xaxs = "i", xlab = "Position", ylab = "Ge

Re: [R] Subscripting a matrix-like object

2010-05-14 Thread Jeffrey J. Hallman
jhall...@frb.gov writes: Answering my own question here, so you can ignore this unless you are really interested in some fairly obscure stuff. It turns out that this works: singleIndex <- missing(j) && (length(sys.call()) == length(match.call())) since sys.call() has an element for the empty ar

Re: [R] finding the plot limits generated by default

2010-05-14 Thread Justin Fincher
Thank you for your reply, but I have additional questions. I agree that getting the common ranges before plotting would be the best scenario, it is just complicated by the fact that the first plot is generated with a function where all the data is passed in and within the function the data is subs

Re: [R] Cubic B-spline, how to numerically integrate?

2010-05-14 Thread David Winsemius
On May 14, 2010, at 11:41 AM, Claudia Penaloza wrote: (corrected version of previous posting) I fit a GAM to turtle growth data following methods in Limpus & Chaloupka 1997 (http://www.int-res.com/articles/meps/149/m149p023.pdf). I want to obtain figures similar to Fig 3 c & f in Limpus &

Re: [R] Fwd: Fwd: nonlinearity and interaction

2010-05-14 Thread William Simpson
Thanks for telling me. Sorry. Don't know why my posts are not showing up here at gmail. Never happened before. Thought they had been lost in the aether. Bill On Fri, May 14, 2010 at 4:43 PM, David Winsemius wrote: > > On May 14, 2010, at 10:42 AM, William Simpson wrote: > > I don't know why my

Re: [R] SAS for R-users

2010-05-14 Thread Seeliger . Curt
Thomas writes: > ... Until then and until I can > convince colleagues and teachers to use better > software, how do you suggest that I learn SAS? > I suspect that it'll be a book on R for SAS-users, > so I'm expecting recommendations of books like > those that are best for R-users learning SAS. As

Re: [R] Histogram Bin

2010-05-14 Thread David Winsemius
On May 14, 2010, at 9:55 AM, Research wrote: Hello, Is there a function that returns the number of the "bin" (or quantile, or percentile etc. etc.) that a value of a variable may belong to? Tor example: breaks<-hist(variable, 18, plot=FALSE) If the following breaks are 5 10 15 20 25 3

Re: [R] multhist,labels and percentages

2010-05-14 Thread Federico Calboli
On 14 May 2010, at 16:09, Thomas Stewart wrote: > Please be more specific with your question. Perhaps a simple subset of the > data you are trying to plot? Here is some non-specific advice: > > Plotting histograms as percentages instead of frequency counts is already an > option of the hist f

Re: [R] Problem with vignette printing

2010-05-14 Thread Prof Brian Ripley
On Fri, 14 May 2010, Sébastien Bihorel wrote: Yes, I have installed R through opensuse's package installer. Is ?Startup the correct place to look at about environment variables or is there a more appropriate help page? Well, ?R_PDFVIEWER brings up a more appropriate page. On Fri, May 14, 2

Re: [R] finding the plot limits generated by default

2010-05-14 Thread Marc Schwartz
On May 14, 2010, at 9:59 AM, Justin Fincher wrote: > I have two datasets that I would like to plot in a single figure. The first > plot is generated by a function that then takes a subset of the data. (It > is biological data so it is usually by chromosome e.g. > function(data1,subset="chr8") )

Re: [R] Fwd: Fwd: nonlinearity and interaction

2010-05-14 Thread David Winsemius
On May 14, 2010, at 10:42 AM, William Simpson wrote: I don't know why my posts aren't showing up on my email acct. I will send again. They both arrived on our accounts. I do not see that sending multiple copies to the list is doing anything constructive. David Winsemius, MD West Hartfo

Re: [R] Replacing double loop by apply

2010-05-14 Thread Andreas Wittmann
Dear Henrique Dallazuanna, thank you very much, this really helped me. by the way, do you thinks it is also possible to do the following loop in R? thanks and best regards Andreas v1 <- rnorm(10) v2 <- v1+rnorm(10) v3 <- v2+rnorm(10) v4 <- rnorm(10) y <- ifelse(v1<0,1,0) dat <- data.frame(v

[R] Cubic B-spline, how to numerically integrate?

2010-05-14 Thread Claudia Penaloza
(corrected version of previous posting) I fit a GAM to turtle growth data following methods in Limpus & Chaloupka 1997 (http://www.int-res.com/articles/meps/149/m149p023.pdf). I want to obtain figures similar to Fig 3 c & f in Limpus & Chaloupka (1997), which according to the figure legend are "e

Re: [R] GAM, GAMM and numerical integration, help please

2010-05-14 Thread Simon Wood
On Thursday 13 May 2010 21:59, Claudia Penaloza wrote: > I am trying to apply methods used by Chaloupka & Limpus (1997) ( > http://www.int-res.com/articles/meps/146/m146p001.pdf) to my own turtle > growth data. > > I am having trouble with two things... > > 1) After the GAM is fit, the residuals

Re: [R] point.in.polygon() in sp package: accuracy problems?

2010-05-14 Thread David Winsemius
On May 14, 2010, at 10:59 AM, David Winsemius wrote: On May 14, 2010, at 4:50 AM, Julien Moeys wrote: Dear list: I encountered some problems using the function point.in.polygon() of the sp package, when trying to determine whether some points lye inside, outside, on the border or on a v

Re: [R] insert values based on common ID

2010-05-14 Thread Erik Iverson
Hello, Good reproducible example. Is > merge(a[names(a) != "weekAvg"], b) what you want? emorway wrote: Forum, with the datasets a and b below, I'm trying to establish a relationship based on the common column "week" and insert the value from the column weekAvg in b to the column weekAvg in

Re: [R] insert values based on common ID

2010-05-14 Thread Marc Schwartz
On May 14, 2010, at 10:15 AM, emorway wrote: > > Forum, > > with the datasets a and b below, I'm trying to establish a relationship > based on the common column "week" and insert the value from the column > weekAvg in b to the column weekAvg in a. The dataset a is several thousand > lines long.

Re: [R] SAS for R-users

2010-05-14 Thread Shi, Tao
Thomas, If you're thinking to leverage your R programming skill in learning SAS, you'll be disappointed, as the two have quite different grammar. The book Erik mentioned is a good start. After that, just reading the SAS help file, which is pretty comprehensive, will keep you busy. ...Tao

[R] insert values based on common ID

2010-05-14 Thread emorway
Forum, with the datasets a and b below, I'm trying to establish a relationship based on the common column "week" and insert the value from the column weekAvg in b to the column weekAvg in a. The dataset a is several thousand lines long. I've tried looking at 'match', writing functions, 'rbind.f

Re: [R] multhist,labels and percentages

2010-05-14 Thread Thomas Stewart
Please be more specific with your question. Perhaps a simple subset of the data you are trying to plot? Here is some non-specific advice: Plotting histograms as percentages instead of frequency counts is already an option of the hist function. For example, pop1<-rnorm(100) hist(pop1,freq=F) I

[R] Integrating R with Text Editor UltraEdit

2010-05-14 Thread Robert White
Hi, I use the text editor UltraEdit. Does anyone have any idea how to (a) run bloc lines of R code (rather than the entire file) from within UE (b) whether running a whole file or just lines, get the graphics to work. I can run entire files of R code from within UltraEdit just fine via a power

[R] finding the plot limits generated by default

2010-05-14 Thread Justin Fincher
I have two datasets that I would like to plot in a single figure. The first plot is generated by a function that then takes a subset of the data. (It is biological data so it is usually by chromosome e.g. function(data1,subset="chr8") ) Since not only are the chromosomes different sizes, but acro

Re: [R] Add 1 week to date with hours included for subset

2010-05-14 Thread emorway
For those whose search lands on this post, here is the solution I found that worked well.80.2<-data.frame(well.80.2,week=floor(as.numeric(difftime(strptime(well.80.2$date,"%m/%d/%Y %H:%M",tz=""),strptime(well.80.2$date[1],"%m/%d/%Y %H:%M",tz=""),tz="",units="hours"))/168)) -- View this message

Re: [R] point.in.polygon() in sp package: accuracy problems?

2010-05-14 Thread David Winsemius
On May 14, 2010, at 4:50 AM, Julien Moeys wrote: Dear list: I encountered some problems using the function point.in.polygon() of the sp package, when trying to determine whether some points lye inside, outside, on the border or on a vertice of a polygon. Any time that you are asking ques

Re: [R] Histogram Bin

2010-05-14 Thread Sean Anderson
On Fri, May 14, 2010 at 10:55 AM, Research wrote: > Is there a function that returns the number of the "bin" (or quantile, or > percentile etc. etc.) that a value of a variable may belong to? Something like this should work: dat <- round(runif(20, 0, 100)) hist.dat <- hist(dat, plot = FALSE) ge

[R] Fwd: Fwd: nonlinearity and interaction

2010-05-14 Thread William Simpson
I don't know why my posts aren't showing up on my email acct. I will send again. -- Forwarded message -- From: William Simpson Date: Fri, May 14, 2010 at 3:00 PM Subject: Re: [R] Fwd: nonlinearity and interaction To: Cc: r-help@r-project.org On Fri, May 14, 2010 at 1:47 PM, Thom

[R] Subscripting a matrix-like object

2010-05-14 Thread jhallman
I have an S3 class called "tis" (Time Indexed Series) which may or may not have multiple columns. I have a function "[<-.tis" that I've reproduced below. My question is this: inside of "[<-.tis", how can I distinguish between calls of the form x[i] <- someValue and x[i,] <- someValue ? In

Re: [R] Histogram Bin

2010-05-14 Thread Robert A LaBudde
> x<- rnorm(200) > hist(x, 18) > str(hist(x, 18)) List of 7 $ breaks : num [1:15] -3 -2.5 -2 -1.5 -1 -0.5 0 0.5 1 1.5 ... $ counts : int [1:14] 3 1 8 12 34 35 40 30 18 11 ... $ intensities: num [1:14] 0.03 0.01 0.08 0.12 0.34 ... $ density: num [1:14] 0.03 0.01 0.08 0.12 0.34 ...

[R] multhist,labels and percentages

2010-05-14 Thread Federico Calboli
Hi All, I am in the annoying position of having to present some data to someone who seems to be somewhat less than numerate. I need to label the y-axes of a multhist with the y-axis labeled not as counts but as percentage of a population. Plotting the standard histogram is in a way fine, all I

Re: [R] Fitting a function

2010-05-14 Thread Mario Valle
Have you tried Eureqa? http://ccsl.mae.cornell.edu/eureqa It tries to discover the model from your data. Try it, it is impressive (at least on my data). Ciao! mario On 14-May-10 15:07, Thomas Levine wrote: Actually, ignore my comment about that link. I don't think that link is wh

Re: [R] Fwd: nonlinearity and interaction

2010-05-14 Thread William Simpson
On Fri, May 14, 2010 at 1:47 PM, Thomas Levine wrote: > Creating the 5 indicator variables will be easy if you post your code > and sample data. This may also allow people to help with the first > problem you were having. Here you go. Fragment of data file with 4000 or so pts: RawTime Time Oxpc

Re: [R] Problem with vignette printing

2010-05-14 Thread Prof Brian Ripley
On Fri, 14 May 2010, Sébastien Bihorel wrote: Hi Duncan, You are right, my options("pdfviewer") is currently an empty string... I will have to look into the documentation to create a .Rprofile (I believe) and set this option at loading. You could, but the help says ‘pdfviewer’: default

[R] Histogram Bin

2010-05-14 Thread Research
Hello, Is there a function that returns the number of the "bin" (or quantile, or percentile etc. etc.) that a value of a variable may belong to? Tor example: breaks<-hist(variable, 18, plot=FALSE) If the following breaks are 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 the boundaries

Re: [R] SAS for R-users

2010-05-14 Thread Erik Iverson
Thomas Levine wrote: There are loads of resources for users of any other statistics package who are learning R. For example http://www.google.com/search?q="r+for+sas-users"; The reverse isn't the case http://www.google.com/search?q="sas+for+r-users"; I can't wait that long. Until then and

Re: [R] Fitting a function

2010-05-14 Thread Thomas Levine
Actually, ignore my comment about that link. I don't think that link is what you want to look at either. y~x^2 fits quite well, but you could also write a loop to run lm() on a bunch of different transformations. foo=list(log,sqrt) for (bar in foo) { plot(bar(x),y) } There may be a funct

Re: [R] Fitting a function

2010-05-14 Thread Gabor Grothendieck
It appears that as one proceeds from right to left that it flattens out at 0.021 so lets try this where we have added a bit to 0.021 to avoid log(0) plot(x, log(0.0211 - y)) and plot(1/x, log(0.0211 - y)) Except for the first point the latter plot looks linear so lets try: fm <- nls(y ~ cbind(

  1   2   >