Re: [R] R-equivalent Stata command: poisson or quasipoisson?

2010-09-12 Thread Wil M Contreras Arbaje
Thanks Bill! Not asking for help with Stata at all, on the contrary: the article mentioned using Stata to fit the model described earlier, and I wasn't sure how to do the same in R (which is what I've used since college). Thanks again, I'll play around a bit glmRob, see what happens

[R] apply over parallel lists and their elements

2010-09-12 Thread Sebastian Gibb
Hello, I have a list like the following: tree-list(); tree[[1]]$node-list(); tree[[2]]$node-list(); tree[[1]]$node$values - 1:10 tree[[2]]$node$values - 1:10 After building the list I have to generate the mean of all values elements with equal indices. Until now I use something like that:

Re: [R] apply over parallel lists and their elements

2010-09-12 Thread Liviu Andronic
On Sun, Sep 12, 2010 at 9:40 AM, Sebastian Gibb li...@sebastiangibb.de wrote: But I want to do a sapply over the values vectors. Try multivariate apply. For more on loops and the apply family check [1]. You might also want to check the plyr package and its documentation. Liviu [1]

Re: [R] scalable delimiters in plotmath

2010-09-12 Thread baptiste auguie
Thanks everyone. I've also had a look at plotmath.c where bgroup is defined for [, {, (, . but not . It seems quite trivial to add it, at first sight, however there is a part that I don't understand in the RenderDelim routine, static BBOX RenderDelim(int which, double dist, int draw, mathContext

Re: [R] Setting scales for ggplot2 with facets

2010-09-12 Thread Sven Laur
Sorry, I was too vague in my initial question. To make it clearer I included the following example: tmp - data.frame(y=runif(10), x=gl(2,5), class=gl(2,5)) p - ggplot(data = tmp) p - p + geom_point(aes(y=y, x=x)) p - p + facet_wrap(~ class, scales = free) p - p + ylim(0, 1) p This code draws

Re: [R] Linux Editor

2010-09-12 Thread Dejian Zhao
Try SciViews-K, an extension for Komodo Edit to transform it into a R editor and GUI. http://www.sciviews.org/SciViews-K/index.html On 2010-8-2 23:35, alphaace wrote: Hi Everyone, I recently have started using R again on a Linux box after spending several years on a Mac. Last I checked, the

[R] create a '3D line plot'

2010-09-12 Thread Karl Brand
Esteemed useRs and developeRs, I need to create a '3D line plot' (proper name?) of which an excellent example can be viewed here: http://cococubed.asu.edu/images/87a/images/unknown_pleasures.jpg I have some experience using the rgl package to create 3D PCA plots, but have no idea where to

Re: [R] apply over parallel lists and their elements

2010-09-12 Thread Sebastian Gibb
Hello, thanks for your answer. mapply fits to my needs. But I don't know how many items would tree have. I can't write them all by hand. How can I generate the arguments for mapply? mapply(mean, tree[[1]]$node$values, tree[[2]]$node$values, ... tree[[k]]$node$values); Kind regards, Sebastian

Re: [R] How to comment out entire code parts in Sweave files

2010-09-12 Thread schuster
Hello Werner, good question. According to this source: http://devdaily.com/blog/post/latex/multi-line-comments-in-latex-begin-123- comment-125-verbatim this can be done with \usepackage{verbatim} and \begin{comment} This is my comment. Note that it can span multiple lines. This is very

Re: [R] create a '3D line plot'

2010-09-12 Thread Duncan Murdoch
On 12/09/2010 10:12 AM, Karl Brand wrote: Esteemed useRs and developeRs, I need to create a '3D line plot' (proper name?) of which an excellent example can be viewed here: http://cococubed.asu.edu/images/87a/images/unknown_pleasures.jpg I have some experience using the rgl package to

Re: [R] How to define new matrix based on an elementary row oper

2010-09-12 Thread Cuckovic Paik
I appreciate all you help. This is only for instructional purpose: A = matrix(c(0,1,1,-2,-3,1,2,-1,0,2,2,4,1,-3,-2,1,-4,-7,-1,-19), ncol=5, byrow=T) B =matrix(sample(c(0,1,1,-2,-3,1,2,-1,0,2,2,4,1,-3,-2,1,-4,-7,-1,-19),), ncol=5, byrow=T) Which print func( A, B, A+B) can print the resulting

Re: [R] create a '3D line plot'

2010-09-12 Thread David Winsemius
On Sep 12, 2010, at 10:12 AM, Karl Brand wrote: Esteemed useRs and developeRs, I need to create a '3D line plot' (proper name?) of which an excellent example can be viewed here: http://cococubed.asu.edu/images/87a/images/unknown_pleasures.jpg Set up blank plot region with proper ranges

Re: [R] Sweave: infelicities with lattice graphics

2010-09-12 Thread Michael Friendly
Just a follow-up on this thread, now with R 2.11.1. I was happy back then to use Deepayan's solution for this, under earlier R versions; but it now gives an error and the Sweave-generated .tex file no longer compiles. ortho-xyplot1-code, keep.source=TRUE, eval=FALSE= library(nlme)

Re: [R] Sweave: infelicities with lattice graphics

2010-09-12 Thread Duncan Murdoch
On 12/09/2010 11:41 AM, Michael Friendly wrote: Just a follow-up on this thread, now with R 2.11.1. I was happy back then to use Deepayan's solution for this, under earlier R versions; but it now gives an error and the Sweave-generated .tex file no longer compiles. ortho-xyplot1-code,

Re: [R] how to you output a vector to a column in excel?

2010-09-12 Thread lord12
What happens if I want to automate this process for say 500 vectors? -- View this message in context: http://r.789695.n4.nabble.com/how-to-you-output-a-vector-to-a-column-in-excel-tp2530470p2536402.html Sent from the R help mailing list archive at Nabble.com.

[R] reshape matrix entities to columns

2010-09-12 Thread Natasha Asar
Greeting R helpers J I am not familiar with R but I have to use it to analyze data set that I have (30,000 20,000) I want to change the structure of the dataset and I am wondering how that might be possible in R A main data looks like this: some entities are empty AgeNo. Age

Re: [R] reshape matrix entities to columns

2010-09-12 Thread David Winsemius
On Sep 12, 2010, at 10:45 AM, Natasha Asar wrote: Greeting R helpers J I am not familiar with R but I have to use it to analyze data set that I have (30,000 20,000) I want to change the structure of the dataset and I am wondering how that might be possible in R A main data looks like

Re: [R] how to you output a vector to a column in excel?

2010-09-12 Thread Joshua Wiley
Well that depends which process you are automating, how your vectors are stored, and where you want them going. Do you want 500 Excel spreadsheets with each vector in Column A? Do you want 1 spreadsheet with each vector appended below the previous? Do you want 1 spreadsheet with each vector in

Re: [R] create a '3D line plot'

2010-09-12 Thread Dennis Murphy
Hi: Another approach is to use lattice: http://lmdvr.r-forge.r-project.org/figures/figures.html Go to Chapter 14 and click on Figure 14.3; the code is on the RHS of the figure. HTH, Dennis On Sun, Sep 12, 2010 at 7:12 AM, Karl Brand k.br...@erasmusmc.nl wrote: Esteemed useRs and developeRs,

[R] How to print matrices in standard format was ... Re: How to define new matrix based on an elementary row oper

2010-09-12 Thread David Winsemius
On Sep 12, 2010, at 11:27 AM, Cuckovic Paik wrote: I appreciate all you help. This is only for instructional purpose: A = matrix(c(0,1,1,-2,-3,1,2,-1,0,2,2,4,1,-3,-2,1,-4,-7,-1,-19), ncol=5, byrow=T) B =matrix(sample(c(0,1,1,-2,-3,1,2,-1,0,2,2,4,1,-3,-2,1,-4,-7,-1,-19),), ncol=5,

Re: [R] reshape matrix entities to columns

2010-09-12 Thread Dennis Murphy
Hi: Here's a made up example using the reshape function: Input data: df - structure(list(center = 1:3, age1 = c(6L, 7L, 5L), n1 = c(10L, 12L, 6L), age2 = c(8L, 8L, 8L), n2 = c(13L, 14L, NA), age3 = c(10L, 10L, 9L), n3 = c(9L, NA, 10L), age4 = c(12L, 11L, 11L), n4 = c(7L, 16L, 12L), age5 = c(14L,

Re: [R] R-equivalent Stata command: poisson or quasipoisson?

2010-09-12 Thread Ben Bolker
Wil M Contreras Arbaje wil.contreras at gmail.com writes: Thanks Bill! Not asking for help with Stata at all, on the contrary: the article mentioned using Stata to fit the model described earlier, and I wasn't sure how to do the same in R (which is what I've used since college).

Re: [R] Sweave: infelicities with lattice graphics

2010-09-12 Thread Deepayan Sarkar
On Sun, Sep 12, 2010 at 8:47 AM, Duncan Murdoch murdoch.dun...@gmail.com wrote: On 12/09/2010 11:41 AM, Michael Friendly wrote: Just a follow-up on this thread, now with R 2.11.1. I was happy back then to use Deepayan's solution for this, under earlier R versions; but it now gives an error

[R] non-integer key for data.table

2010-09-12 Thread Anyi Zhu
Hi all, Say if I have a data table which consists of 4 column: itemID, location and price, which location is a text field and itemID and location together forms the primary keys. when I tried to run setkey (DT, itemID, location), I got the following message: Error in setkey (DT, itemID,

Re: [R] mapping array

2010-09-12 Thread Gregory Ryslik
Worked great, thanks! On Sep 11, 2010, at 8:26 PM, bill.venab...@csiro.au bill.venab...@csiro.au wrote: Is this the kind of thing you are talking about? ### 8 cut here 8 ### A - rep(NA, 100) B - sort(runif(25)) C - sort(sample(1:100, 25)) A[C] - B B C A ### 8 cut here 8 ###

[R] using read.table, removing extra quotation mark from a text field? (e.g. cat )

2010-09-12 Thread Eva Nordstrom
I am using read.table to import a text file within R.   There are several errors in my text file.  An extra quotation mark has inadvertently been included within a few text fields.   e.g. for a pipe (|) delimited text file, I have something similar to this:   1|7|30| dog 2|6|25| cat 3|4|20|

Re: [R] R-equivalent Stata command: poisson or quasipoisson?

2010-09-12 Thread Wil M Contreras Arbaje
Thank you Ben, From the article, the purpose of the author's methodology is to better handle heteroskedasticity (due, in part, to Jensen's inequality). Either way, I'll try both, and see how they compare, as I'd like the R estimation to match the Stata one. Thanks again for your insight,

Re: [R] reshape matrix entities to columns

2010-09-12 Thread Natasha Asar
I changed it so i hope it will look better now the matrix is like this: AgeNo. Age No. AgeNo. Center1 52 8 7 Center210 720 9 4 10 column name = sequence of age-no. But what I want the data to

[R] replacing matrix column entities as columns name

2010-09-12 Thread Natasha Asar
I am sending this again as they told me that the data was unreadable, so really hope that this will work...so sorry all note: matrix contains a lot of empty entities Greeting R helpers I am not familiar with R but I have to use it to analyze data set that I have (30,000 20,000) I want to

[R] Efficient ways of merging data frames

2010-09-12 Thread Anyi Zhu
Hi all, I am just wondering if there is a more efficient way of merging two large datasets based on the values of multiple columns, some of which are not numerical. The default merge function in dataframe is very inefficient and the merge function in data.table seems to be faster, but it does

Re: [R] Sweave: infelicities with lattice graphics

2010-09-12 Thread Michael Friendly
Thanks Deepayan and Duncan. The eval=FALSE was the problem, rather than anything with lattice. Not sure why that worked earlier, but I no longer care. -Michael Deepayan Sarkar wrote: On Sun, Sep 12, 2010 at 8:47 AM, Duncan Murdoch murdoch.dun...@gmail.com wrote: On 12/09/2010 11:41 AM,

Re: [R] non-integer key for data.table

2010-09-12 Thread Dennis Murphy
Hi: Convert the location to factor and you should be OK: x - factor(sample(LETTERS[1:3], 10, replace = TRUE)) storage.mode(x) [1] integer BTW, data.table has its own mailing list: Send datatable-help mailing list submissions to datatable-h...@lists.r-forge.r-project.org To subscribe or

Re: [R] reshape matrix entities to columns

2010-09-12 Thread Dennis Murphy
Hi: Natasha said: I changed it so i hope it will look better now the matrix is like this: AgeNo. Age No. AgeNo. Center1 52 8 7 Center210 720 9 4 10 column name = sequence of age-no. But what I

Re: [R] Efficient ways of merging data frames

2010-09-12 Thread jim holtman
Have you tried 'pasting' the values together and then using this as the key for the join? On Sun, Sep 12, 2010 at 2:39 PM, Anyi Zhu anyi@gmail.com wrote: Hi all, I am just wondering if there is a more efficient way of merging two large datasets based on the values of multiple columns,

[R] average matrices across a list

2010-09-12 Thread Gregory Ryslik
Hi, I have a list of several hundred 2 dimensional matrices, where each matrix is n x m. What I need to do is that for each n,m I need an average over all the lists. This would collapse it down to just one nxm matrix. Any easy ways to do that? As always, I'd like to avoid a for loop to keep

Re: [R] scalable delimiters in plotmath

2010-09-12 Thread David Winsemius
On Sep 12, 2010, at 6:15 AM, baptiste auguie wrote: Thanks everyone. I've also had a look at plotmath.c where bgroup is defined for [, {, (, . but not . It seems quite trivial to add it, at first sight, however there is a part that I don't understand in the RenderDelim routine, static BBOX

Re: [R] average matrices across a list

2010-09-12 Thread Gregory Ryslik
Sorry, I forgot to add that some of the entries in various matrices have NA in them. On Sep 12, 2010, at 3:40 PM, Gregory Ryslik wrote: Hi, I have a list of several hundred 2 dimensional matrices, where each matrix is n x m. What I need to do is that for each n,m I need an average over

Re: [R] average matrices across a list

2010-09-12 Thread Phil Spector
Gregory - Suppose your list is called mymats. Then Reduce(+,mymats) does what you want. - Phil On Sun, 12 Sep 2010, Gregory Ryslik wrote: Hi, I have a list of several hundred 2 dimensional matrices, where each matrix is n x m. What I need to do is

Re: [R] URL error when trying to use help function in R [Sec: UNOFFICIAL]

2010-09-12 Thread Gosse, Michelle
Thanks for the feedback. Peter, I have forwarded your response to our ICT division to see if there is anything they can do. One potentially silly question: what would happen if I had the help files loaded locally on my PC - would the call then work? I'm wondering about the wisdom of creating a

Re: [R] average matrices across a list

2010-09-12 Thread Gregory Ryslik
Hi, Doing that I get the following: Browse[2] Reduce[+,results] Error in Reduce[+, results] : object of type 'closure' is not subsettable Thanks again! Kind regards, Greg On Sep 12, 2010, at 3:49 PM, Phil Spector wrote: Gregory - Suppose your list is called mymats. Then

Re: [R] scalable delimiters in plotmath

2010-09-12 Thread baptiste auguie
Oh, right I see. I was completely off then. Maybe it's not so easy to add delimiters after all, I'll have to look at the list of symbol pieces to see if these can be constructed too. Thanks, baptiste On 12 September 2010 21:42, David Winsemius dwinsem...@comcast.net wrote: On Sep 12, 2010,

Re: [R] using read.table, removing extra quotation mark from a text field? (e.g. cat )

2010-09-12 Thread jim holtman
You can use the 'gsub' command to remove the quote marks. You could readLines/writeLines the file to clean it up with gsub before using read.table on it so it can all be done within R. On Sun, Sep 12, 2010 at 1:58 PM, Eva Nordstrom eva.nordst...@yahoo.com wrote: I am using read.table to import

Re: [R] scalable delimiters in plotmath

2010-09-12 Thread Paul Murrell
Hi On 13/09/2010 7:57 a.m., baptiste auguie wrote: Oh, right I see. I was completely off then. Maybe it's not so easy to add delimiters after all, I'll have to look at the list of symbol pieces to see if these can be constructed too. The plotmath stuff assumes a font with an Adobe Symbol

Re: [R] URL error when trying to use help function in R [Sec: UNOFFICIAL]

2010-09-12 Thread Duncan Murdoch
On 12/09/2010 3:50 PM, Gosse, Michelle wrote: Thanks for the feedback. Peter, I have forwarded your response to our ICT division to see if there is anything they can do. One potentially silly question: what would happen if I had the help files loaded locally on my PC - would the call then

Re: [R] create a '3D line plot'

2010-09-12 Thread Karl Brand
Cheers! All excellent, runable examples helping me progress quickly. Being more a qualitative plot, the y-axis is less important. But it did get me thinking- Coloring each of the plotted lines, say 'altitude colors' like the classic volcano example to reflect the (scaled) values the lines

Re: [R] scalable delimiters in plotmath

2010-09-12 Thread baptiste auguie
I see, thanks. Looking at this table I guess the short answer is no, these cannot be made to scale and the only ones that could have already been implemented in bgroup(). Thanks, baptiste On 12 September 2010 22:11, Paul Murrell p.murr...@auckland.ac.nz wrote: Hi On 13/09/2010 7:57 a.m.,

Re: [R] Efficient ways of merging data frames

2010-09-12 Thread Dennis Murphy
Hi: On Sun, Sep 12, 2010 at 11:39 AM, Anyi Zhu anyi@gmail.com wrote: Hi all, I am just wondering if there is a more efficient way of merging two large datasets based on the values of multiple columns, some of which are not numerical. As noted in your previous post, the variables

Re: [R] scalable delimiters in plotmath

2010-09-12 Thread David Winsemius
On Sep 12, 2010, at 4:11 PM, Paul Murrell wrote: Hi On 13/09/2010 7:57 a.m., baptiste auguie wrote: Oh, right I see. I was completely off then. Maybe it's not so easy to add delimiters after all, I'll have to look at the list of symbol pieces to see if these can be constructed too. The

Re: [R] reshape matrix entities to columns

2010-09-12 Thread David Winsemius
On Sep 12, 2010, at 3:34 PM, Dennis Murphy wrote: Hi: Natasha said: I changed it so i hope it will look better now the matrix is like this: AgeNo. Age No. AgeNo. Center1 52 8 7 Center210 720 9 4

Re: [R] using read.table, removing extra quotation mark from a text field? (e.g. cat )

2010-09-12 Thread Wil M Contreras Arbaje
While you are looking for a solution within R, it might be simpler to open your text file in almost any free text editor (Notepad++, Textwrangler, Smultron, vim come to mind), and do Replace all ' for . On Sep 12, 2010, at 3:58 PM, jim holtman wrote: You can use the 'gsub' command to

Re: [R] average matrices across a list

2010-09-12 Thread Ben Bolker
Gregory Ryslik rsaber at comcast.net writes: Browse[2] Reduce[+,results] Error in Reduce[+, results] : object of type 'closure' is not subsettable You need to use parentheses, not square brackets. __ R-help@r-project.org mailing list

Re: [R] average matrices across a list

2010-09-12 Thread Phil Spector
Gregory - Please provide a reproducible example. I have no idea what results is. - Phil On Sun, 12 Sep 2010, Gregory Ryslik wrote: Hi, Doing that I get the following: Browse[2] Reduce[+,results] Error in Reduce[+, results] : object of type 'closure' is

Re: [R] average matrices across a list

2010-09-12 Thread Gregory Ryslik
Hi, Thanks, I was using the square brackets instead of (. The ( makes it work. However, some of my matrices have NA for some values. I need those NA's to basically not be counted. And if all the lists have NA for a specific (n,m), I want it to remain an (n,m). By using the Reduce('+', mymats),

Re: [R] create a '3D line plot'

2010-09-12 Thread Dennis Murphy
Hi: Here's a fairly basic ggplot2 version with a few warts in it: # Generate means means - rpois(30, 10) # Create 30 Gaussian random samples of size 100, using means to # define the population mean for each sample (via sapply) df - data.frame(ds = rep(1:30, each = 100), x =

Re: [R] using read.table, removing extra quotation mark from a text field? (e.g. cat )

2010-09-12 Thread Dennis Murphy
Hi: On Sun, Sep 12, 2010 at 1:05 PM, Wil M Contreras Arbaje wil.contre...@gmail.com wrote: While you are looking for a solution within R, it might be simpler to open your text file in almost any free text editor (Notepad++, Textwrangler, Smultron, vim come to mind), and do Replace all ' for

Re: [R] reshape matrix entities to columns

2010-09-12 Thread Dennis Murphy
Thanks, David; I overlooked that part. Dennis On Sun, Sep 12, 2010 at 1:18 PM, David Winsemius dwinsem...@comcast.netwrote: On Sep 12, 2010, at 3:34 PM, Dennis Murphy wrote: Hi: Natasha said: I changed it so i hope it will look better now the matrix is like this:

Re: [R] How to print matrices in standard format was ... Re: How to define new matrix based on an elementary row oper

2010-09-12 Thread David Winsemius
On Sep 12, 2010, at 12:24 PM, David Winsemius wrote: On Sep 12, 2010, at 11:27 AM, Cuckovic Paik wrote: I appreciate all you help. This is only for instructional purpose: A = matrix(c(0,1,1,-2,-3,1,2,-1,0,2,2,4,1,-3,-2,1,-4,-7,-1,-19), ncol=5, byrow=T) B =

Re: [R] using read.table, removing extra quotation mark from a text field? (e.g. cat )

2010-09-12 Thread Wil M Contreras Arbaje
True, I'd actually misread the problem as being ' and not . In the interest of expediency, here's one solution I can think off the top of my head: using MS-Word (dunno if it's taboo in these lists, but it's what I have at hand at the moment–I believe in using all the tools available, if it

[R] CRAN (and crantastic) updates this week

2010-09-12 Thread Crantastic
CRAN (and crantastic) updates this week New packages * aratio (1.0) Maintainer: Daniel McMillen Author(s): Daniel McMillen http://crantastic.org/packages/aratio Tools for analyzing assessment ratios * DeducerPlugInScaling (0.0-5) Maintainer: Alberto Mirisola Author(s):

Re: [R] How to print matrices in standard format was ... Re: How to define new matrix based on an elementary row oper

2010-09-12 Thread Cuckovic Paik
Thanks David. grid graphic works pretty well. -- View this message in context: http://r.789695.n4.nabble.com/How-to-define-new-matrix-based-on-an-elementary-row-operation-in-a-single-step-tp2341768p2536785.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] average matrices across a list

2010-09-12 Thread Ben Bolker
My next suggestion (I don't have time to work out or test an example at the moment): library(abind) tmparr - abind(m1,m2,m3,...,along=3) OR tmparr - do.call(c(matlist,list(along=3))) apply(tmparr,c(1,2),mean,na.rm=TRUE) or something along those lines.

[R] Problem with all.equal and POSIXt.

2010-09-12 Thread Rolf Turner
I'm getting an error when applying all.equal() to objects of class POSIXt. E.g. x - strptime(rep(2007-02-12,10),format=%Y-%m-%d) all.equal(x,x) Error in target[[i]] : subscript out of bounds The object seems to have to be of double-digit length to trigger the error. E.g.

Re: [R] average matrices across a list

2010-09-12 Thread Gregory Ryslik
Hi Everyone, Thanks to everyone for their help. With your suggestions and some poking around, the following works for what I need. It basically adds all the matrices elementwise, and adds nothing if the element is NA. Thanks again! Code below: ** mymats -

Re: [R] using read.table, removing extra quotation mark from a text field? (e.g. cat )

2010-09-12 Thread Dennis Murphy
Hi: Thanks to Jakson Aquino, who showed me how to do a proper text substitution, we have a way out. It also turns out that in the last line, the last numeric field was missing, so I inserted an NA| in the last line of the data file before calling readLines(). His (correct) code is at the bottom

[R] How to do a trig regression

2010-09-12 Thread Aaditya Nanduri
Hello All, I cant seem to do a trig regression in R. The equation is as follows : y = a+b*(sin((2*pi*x/360) - c))^2 a, b, c are coefs that I want. y, x are input vectors. The equation I put into R: lm(y ~ sin(2*pi*x/360)^2) This equation is missing the c and I dont get the right answer. Also,

Re: [R] Problem with all.equal and POSIXt.

2010-09-12 Thread Joshua Wiley
I get the same error. On debugging, after the 10th iteration (~1,375 lines after the all.equal(x, x) call), I get: exiting from: all.equal(target[[i]], current[[i]], check.attributes = check.attributes, ...) debugging in: all.equal(target[[i]], current[[i]], check.attributes =

Re: [R] Problem with all.equal and POSIXt.

2010-09-12 Thread Peter Ehlers
On 2010-09-12 20:32, Joshua Wiley wrote: I get the same error. On debugging, after the 10th iteration (~1,375 lines after the all.equal(x, x) call), I get: exiting from: all.equal(target[[i]], current[[i]], check.attributes = check.attributes, ...) debugging in: all.equal(target[[i]],

Re: [R] Problem with all.equal and POSIXt.

2010-09-12 Thread Rolf Turner
On 13/09/2010, at 3:07 PM, Peter Ehlers wrote: SNIP I'm not sure that I would call this a bug, but it would seem helpful to return an appropriate error message or to coerce to POSIXct. Note that all.equal(as.POSIXct(x), as.POSIXct(x)) yields TRUE, as does using as.Date(x).

Re: [R] How to do a trig regression

2010-09-12 Thread David Winsemius
On Sep 12, 2010, at 10:23 PM, Aaditya Nanduri wrote: Hello All, I cant seem to do a trig regression in R. The equation is as follows : y = a+b*(sin((2*pi*x/360) - c))^2 a, b, c are coefs that I want. y, x are input vectors. The equation I put into R: lm(y ~ sin(2*pi*x/360)^2) This equation

[R] Overlay of two graphs of different axes

2010-09-12 Thread Uwe Dippel
Though I have read quite a bit, and tried quite a bit, I have yet to find a nice way to overlay 2 or more curves in the same plot, with different ranges. Here is simplified sample code to demonstrate the question: plot(2*(seq(1,5)), type=l, axes=FALSE) curve(2*(seq(1,5)), type=b, add=TRUE)