[R] Modify base R functions in Rprofile.site

2009-10-04 Thread Yihui Xie
Hi everyone, I want to modify two base R functions 'parse' and 'deparse' immediately after R has started, so I added some code in the file 'Rprofile.site' under the 'etc' directory. Here is a simple example: parse=function(...){ base::parse(...) } I'll get an error when I start R as

Re: [R] Paste a character to an object

2009-10-04 Thread Tim Clark
David, Thanks! You just gave me the answer. All I had to do was: xx-c() for (i in c('100', '75', '50') ) { x-homerange[[1]]$polygons[[i]] ; xx-rbind(x,xx) } xx I didn't know you could use characters as index values in a for loop, or that you could use characters in double brackets instead

Re: [R] Paste a character to an object

2009-10-04 Thread David Winsemius
On Oct 4, 2009, at 3:40 AM, Tim Clark wrote: David, Thanks! You just gave me the answer. All I had to do was: xx-c() for (i in c('100', '75', '50') ) { x-homerange[[1]]$polygons[[i]] ; xx-rbind(x,xx) } xx I didn't know you could use characters as index values in a for loop, or that you

Re: [R] add lines() to 1st plot in layout() after calling 2nd plot()?

2009-10-04 Thread Marianne Promberger
Thanks for the quick reply. However ... David Winsemius dwinsem...@comcast.net 03-Oct-09 20:50: MP layout(matrix(c(1,2),1)) MP plot(1:10,main=left plot) MP plot(10:1,main=right plot) MP lines(c(3:7,7:3),col=red) MP MP but of course now lines() gets added to the right plot. I MP MP Is there any

Re: [R] offlist Re: AW: Urgently needed Exercise solutions related to PracticalData Analysis Using R Statisctial Software

2009-10-04 Thread David Winsemius
On Oct 4, 2009, at 1:42 AM, Daniel Malter wrote: http://www.odesk.com/jobs/College-Assistance_~~dd7622f6bdef9177 He is one very cheeky blighter isn't he? Why would he say he was a student in a foreign university? Does he think it will lower the readers' concern for academic malfeasance

Re: [R] add lines() to 1st plot in layout() after calling 2nd plot()?

2009-10-04 Thread baptiste auguie
Hi, Try this, dev.new() layout(matrix(1:4,2, by=T)) plot(1:10,main=top left plot) plot(1:10,main=top right plot) plot(1:10,main=bottom left plot) plot(1:10,main=bottom right plot) for (ii in 1:2){ for (jj in 1:2){ par(mfg=c(ii,jj)) text(5,2, lab=paste(plot #:,ii,,,jj,sep=)) } } par(mfg=c(1,1))

Re: [R] add lines() to 1st plot in layout() after calling 2nd plot()?

2009-10-04 Thread baptiste auguie
After some checking, I think the documentation is at best misleading on this particular query. Nowhere could I find mention that par(mfg) can work with layout. Instead, I found a warning that suggests incompatibility (since mpg is explicitly tied to mfrow in ?par and layout is said incompatible

Re: [R] add lines() to 1st plot in layout() after calling 2nd plot()?

2009-10-04 Thread Marianne Promberger
baptiste auguie 04-Oct-09 10:32: dev.new() layout(matrix(1:4,2, by=T)) plot(1:10,main=top left plot) plot(1:10,main=top right plot) plot(1:10,main=bottom left plot) plot(1:10,main=bottom right plot) [...] par(mfg=c(1,1)) lines(c(3:7,7:3),col=red) Brilliant! Thanks! baptiste auguie

Re: [R] Numerical.summary Error

2009-10-04 Thread Peter Ehlers
It's probably called summaryStats() now. -Peter Ehlers Rene wrote: Dear all, Have you experienced problem of using numerical.summary() function? I used to be able to run this function in R, but not any more. Now I try to use this function, it gives me error like this: Error: could

Re: [R] Access to conditioning variables (lattice)

2009-10-04 Thread Deepayan Sarkar
On Thu, Sep 24, 2009 at 2:14 PM, Martin Lepage martin.d.lep...@gmail.com wrote: The problem I am facing is that I do not know how to generically access the conditioning variables within the panel function. In this simple case, I can achieve what I want to do with the following call :    

[R] Copying matrices with certain probabilities

2009-10-04 Thread William Aue
Hi all! Below is the problem I am struggling with. Let’s say I have a matrix (x) of values: # [,1] [,2] [,3] [,4] #[1,]    1    3    2    1 #[2,]    2    1    3    2 I need to copy the items into a new matrix (y) with certain probability guidelines. I need to set it up such that: 1. for

Re: [R] help about solving the equations

2009-10-04 Thread Berend Hasselman
dahuang wrote: i wanna get x from the equations: Ax=x, given A is a matrix. How can i apply it in R? thanks ?solve -- View this message in context: http://www.nabble.com/help-about-solving-the-equations-tp25738073p25738401.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] Levelplot without margins

2009-10-04 Thread Deepayan Sarkar
On Mon, Sep 28, 2009 at 9:08 AM, Antje antje.niederl...@yahoo.de wrote: I had a bit success with the following usage: my.padding - list(layout.heights = list(                        top.padding = 0,                        main.key.padding = 0,                        key.axis.padding = 0,    

Re: [R] xyplot key

2009-10-04 Thread Deepayan Sarkar
On Wed, Sep 30, 2009 at 6:54 AM, Andrewjohnclose a.j.cl...@ncl.ac.uk wrote: Hi, I'm having trouble matching the symbols/color of the key to match those specifiec in the plot. Here is the code I used: xyplot(GCR+GCT ~ FRAC, data=RWF, type=c(g,p),cex=1.2,pch=c(22,21),

Re: [R] Copying matrices with certain probabilities

2009-10-04 Thread David Winsemius
On Oct 4, 2009, at 9:36 AM, William Aue wrote: Hi all! Below is the problem I am struggling with. Let’s say I have a matrix (x) of values: # [,1] [,2] [,3] [,4] #[1,]1321 #[2,]2132 I need to copy the items into a new matrix (y) with certain probability

[R] extraction from data.frame

2009-10-04 Thread sabrina.michielin
Hi, I extracted from a data.frame (x) of 27 columns a smaller data.frame (x2) with 12 columns whit the following: x2=x[, c(BROVISINGVal, CHATVal, EMAILVal, ..., Piano.Tariffario)] Anyway I want to form x2 by extracting all the rows that assume any value for the first 11 columns but a

[R] help about solving the equations

2009-10-04 Thread dahuang
i wanna get x from the equations: Ax=x, given A is a matrix. How can i apply it in R? thanks -- View this message in context: http://www.nabble.com/help-about-solving-the-equations-tp25738073p25738073.html Sent from the R help mailing list archive at Nabble.com.

[R] convenience question

2009-10-04 Thread Philip A. Viton
On: R 2.8.1 / Ms Windows / R-Gui-R-console I have a long-ish function, and to re-assure myself that it's actually making progress I've arranged a set of messages to the console (using cat). But what happens is that the messages don't actually display until the function has finished, which

Re: [R] Modify base R functions in Rprofile.site

2009-10-04 Thread cls59
Yihui Xie wrote: Hi everyone, I want to modify two base R functions 'parse' and 'deparse' immediately after R has started, so I added some code in the file 'Rprofile.site' under the 'etc' directory. Here is a simple example: parse=function(...){ base::parse(...) } I'll get

Re: [R] Modify base R functions in Rprofile.site

2009-10-04 Thread Duncan Murdoch
On 04/10/2009 12:41 PM, cls59 wrote: Yihui Xie wrote: Hi everyone, I want to modify two base R functions 'parse' and 'deparse' immediately after R has started, so I added some code in the file 'Rprofile.site' under the 'etc' directory. Here is a simple example: Why not just modify their

Re: [R] extraction from data.frame

2009-10-04 Thread David Winsemius
On Oct 4, 2009, at 12:09 PM, sabrina.michie...@alice.it wrote: Hi, I extracted from a data.frame (x) of 27 columns a smaller data.frame (x2) with 12 columns whit the following: x2=x[, c(BROVISINGVal, CHATVal, EMAILVal, ..., Piano.Tariffario)] Something like this (untested): x2=x[

Re: [R] Modify base R functions in Rprofile.site

2009-10-04 Thread cls59
Duncan Murdoch-2 wrote: Why not just modify their source, and rebuild R? Duncan Murdoch In my case, the IT guys don't always provide the necessary tools and/or permissions to do this. Which is why we are fortunate that R is so flexible as to allow modification of core routines in

Re: [R] help about solving the equations

2009-10-04 Thread Gabor Grothendieck
x is the eigenvector corresponding to eigenvalue 1. See ?eigen. On Sun, Oct 4, 2009 at 9:31 AM, dahuang tsyell...@hotmail.com wrote: i wanna get x from the equations: Ax=x, given A is a matrix. How can i apply it in R? thanks -- View this message in context:

Re: [R] help about solving the equations

2009-10-04 Thread Berend Hasselman
Gabor Grothendieck wrote: x is the eigenvector corresponding to eigenvalue 1. See ?eigen. Correct. I should have looked better. Berend -- View this message in context: http://www.nabble.com/help-about-solving-the-equations-tp25738073p25740459.html Sent from the R help mailing list

[R] Row to Column help

2009-10-04 Thread AC Del Re
Dear R Community, I am attempting to transpose a dataset from rows to columns but am stuck. I have tried using reshape() with little luck, possibly due to the categorical nature of the data. For example: id-c(1,2,2,3,3,3) author-c(j,k,k,l,l,l) tmt-c(cbt,act,dbt,act,act,cbt)

Re: [R] Row to Column help

2009-10-04 Thread Phil Spector
AC - The easiest way I can think of is to create a time variable, so reshape will know which observation to call 1, 2, or 3. data$time = unlist(sapply(split(data,data$id),function(x)1:nrow(x))) or data$time = unlist(tapply(data$id,data$id,function(x)1:length(x)) Then

Re: [R] Help for 3D Plotting Data on 'Irregular' Grid

2009-10-04 Thread Deepayan Sarkar
On Thu, Oct 1, 2009 at 6:38 AM, Lorenzo Isella lorenzo.ise...@gmail.com wrote: Dear All, Here is what I am trying to achieve: I would like to plot some data in 3D. Usually, one has a matrix of the kind y_1(x_1) , y_1(x_2).y_1(x_i) y_2(x_1) , y_2(x_2).y_2(x_i)

Re: [R] changing number of axis

2009-10-04 Thread Deepayan Sarkar
On Thu, Oct 1, 2009 at 11:30 PM, Dan Kortschak dan.kortsc...@adelaide.edu.au wrote: Thanks for that again. That almost works, except that lines are drawn between non-empty bins (in various degrees of diagonality), so absent points (important here) don't show clearly. It's not a huge issue, so I

Re: [R] Row to Column help

2009-10-04 Thread AC Del Re
Wonderful, Phil! Your suggestion produced the exact format I desired. Thank you kindly, AC Del Re On Sun, Oct 4, 2009 at 2:03 PM, Phil Spector spec...@stat.berkeley.eduwrote: AC - The easiest way I can think of is to create a time variable, so reshape will know which observation

[R] is that possible to graph 4 dimention plot

2009-10-04 Thread gcheer3
Suppose there are 4 variables d is a function of a , b and c I want to know how a, b and c change will make d change It will be straightforward to see it if we can graph the d surface if d is only a function of a and b, I can use 'persp' to see the surface of d. I can easily see at what values

Re: [R] is that possible to graph 4 dimention plot

2009-10-04 Thread Duncan Murdoch
On 04/10/2009 3:14 PM, gcheer3 wrote: Suppose there are 4 variables d is a function of a , b and c I want to know how a, b and c change will make d change It will be straightforward to see it if we can graph the d surface if d is only a function of a and b, I can use 'persp' to see the surface

Re: [R] Problem using with panel.average in Lattice package

2009-10-04 Thread Deepayan Sarkar
On Fri, Oct 2, 2009 at 8:03 PM, Mark Dalphin mark.dalp...@peblnz.com wrote: Hi, I'm having a problem getting the panel.average function to work as I expect it to in a lattice plot. I wish to draw lines between the averages of groups of y-values at specific x-values. I have created a dataset

Re: [R] update'ing trellis object

2009-10-04 Thread Deepayan Sarkar
On Sat, Oct 3, 2009 at 7:35 PM, David Winsemius dwinsem...@comcast.net wrote: On Oct 3, 2009, at 7:05 PM, Sebastian P. Luque wrote: Hi, I thought the following would only remove the legend element of a trellis object, but it actually removes both the legend and key elements:

Re: [R] update'ing trellis object

2009-10-04 Thread Gabor Grothendieck
On Sun, Oct 4, 2009 at 3:45 PM, Deepayan Sarkar deepayan.sar...@gmail.com wrote: Yes, unfortunately the trellis object cannot distinguish between the legend and the key any more. If you are willing to muck around at the grid level you can do it. First list out the grid objects using

Re: [R] update'ing trellis object

2009-10-04 Thread Sebastian P. Luque
On Sun, 4 Oct 2009 16:14:58 -0400, Gabor Grothendieck ggrothendi...@gmail.com wrote: On Sun, Oct 4, 2009 at 3:45 PM, Deepayan Sarkar deepayan.sar...@gmail.com wrote: Yes, unfortunately the trellis object cannot distinguish between the legend and the key any more. If you are willing to muck

Re: [R] Modify base R functions in Rprofile.site

2009-10-04 Thread Yihui Xie
Thanks a lot, Charlie. What a coincidence -- I'm also working on Sweave functions. parse() and deparse() can make the code more tidy (they are used in source() and RweaveLatexRuncode()), RweaveLatex function () { list(setup = RweaveLatexSetup, runcode = RweaveLatexRuncode, writedoc =

Re: [R] Problem using with panel.average in Lattice package

2009-10-04 Thread Peter Ehlers
Deepayan, Is something similar needed in the last example in ?xyplot? I don't see panel.linejoin producing any lines. Regards, Peter Ehlers Deepayan Sarkar wrote: On Fri, Oct 2, 2009 at 8:03 PM, Mark Dalphin mark.dalp...@peblnz.com wrote: Hi, I'm having a problem getting the panel.average

Re: [R] Modify base R functions in Rprofile.site

2009-10-04 Thread Duncan Murdoch
On 04/10/2009 6:07 PM, Yihui Xie wrote: Thanks a lot, Charlie. What a coincidence -- I'm also working on Sweave functions. parse() and deparse() can make the code more tidy (they are used in source() and RweaveLatexRuncode()), RweaveLatex function () { list(setup = RweaveLatexSetup,

Re: [R] is that possible to graph 4 dimention plot

2009-10-04 Thread milton ruser
How about : google r graph gallery 4d ? abs On Sun, Oct 4, 2009 at 3:31 PM, Duncan Murdoch murd...@stats.uwo.ca wrote: On 04/10/2009 3:14 PM, gcheer3 wrote: Suppose there are 4 variables d is a function of a , b and c I want to know how a, b and c change will make d change It will be

Re: [R] changing number of axis

2009-10-04 Thread Dan Kortschak
Hi Deepayan, I'm building the pipeline to generate the data, so that can easiy be inserted into the code upstream. Thanks for your help. Dan On Sun, 2009-10-04 at 12:16 -0700, Deepayan Sarkar wrote: On Thu, Oct 1, 2009 at 11:30 PM, Dan Kortschak dan.kortsc...@adelaide.edu.au wrote: Thanks

Re: [R] Modify base R functions in Rprofile.site

2009-10-04 Thread cls59
Yihui Xie wrote: Thanks a lot, Charlie. What a coincidence -- I'm also working on Sweave functions. parse() and deparse() can make the code more tidy (they are used in source() and RweaveLatexRuncode()), RweaveLatex function () { list(setup = RweaveLatexSetup, runcode =

Re: [R] update'ing trellis object

2009-10-04 Thread David Winsemius
I wonder if you noticed that you had managed to create a fig object that has two inside lists by specifying first a key list which required a legend list, and then specifying a legend list that also had a key function? The solution to your specific request by Kortschak nulled-out the

Re: [R] Urgently needed Exercise solutions related to Practical Data Analysis Using R Statisctial Software

2009-10-04 Thread John Kane
Ah, but the offer of the permanent job with a foreign company is so enticing. BTW I think he says that he is a computer science student. I doubt business school students would be so cheap. --- On Sat, 10/3/09, David Winsemius dwinsem...@comcast.net wrote: From: David Winsemius

[R] CRAN (and crantastic) updates this week

2009-10-04 Thread Crantastic
CRAN (and crantastic) updates this week New packages * EQL (1.0-0) Thorn Thaler http://crantastic.org/packages/EQL Computation of the EQL for a given family of variance functions, Saddlepoint-approximations and related auxiliary functions (e.g. Hermite polynomials) *

Re: [R] multicore - no parallel

2009-10-04 Thread David M Smith
On Sat, Oct 3, 2009 at 7:13 PM, dunno87 benparker1...@hotmail.com wrote: Thanks for the help in advance. I just want to know if there is absolutely any way of using multicore if my loop can't run in parallel as each iteration depends on the previous iteration. I have Windows R 2.9.2 and

[R] Ask about the memory size problem

2009-10-04 Thread Yi Du
Hi there, I run a loop program with R and need to save the variable in each step into a vector. After I ran the code, R told me that Error: cannot allocate vector of size 266.6 Mb. Is there any solution of this kind of problem? Thank you for your attention. Yi -- Yi Du [[alternative

Re: [R] update'ing trellis object

2009-10-04 Thread David Winsemius
On Oct 4, 2009, at 7:23 PM, David Winsemius wrote: I wonder if you noticed that you had managed to create a fig object that has two inside lists by specifying first a key list which required a legend list, and then specifying a legend list that also had a key function? The solution to

Re: [R] Ask about the memory size problem

2009-10-04 Thread David Winsemius
On Oct 4, 2009, at 9:22 PM, Yi Du wrote: Hi there, I run a loop program with R and need to save the variable in each step into a vector. Data? Code? After I ran the code, R told me that Error: cannot allocate vector of size 266.6 Mb. Is there any solution of this kind of problem?

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

2009-10-04 Thread stephen sefick
http://waterdata.usgs.gov/nwis/uv?format=rdbperiod=7site_no=021973269 I would like to be able to parse this file up: I can do this x - read.table(http://waterdata.usgs.gov/nwis/uv?format=rdbperiod=7site_no=021973269;, skip=26) but If I add another gauge to this x -

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

2009-10-04 Thread Gabor Grothendieck
Its not completely clear what you want to preserve and what you want to eliminate but try this: L - readLines(http://waterdata.usgs.gov/nwis/uv?format=rdbperiod=7site_no=021973269,06018500;) L.USGS - grep(^USGS, L, value = TRUE) DF - read.table(textConnection(L.USGS), fill = TRUE) head(DF)

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

2009-10-04 Thread Rolf Turner
On 5/10/2009, at 2:49 PM, stephen sefick wrote: http://waterdata.usgs.gov/nwis/uv? format=rdbperiod=7site_no=021973269 I would like to be able to parse this file up: I can do this x - read.table(http://waterdata.usgs.gov/nwis/uv? format=rdbperiod=7site_no=021973269, skip=26) but If I add

[R] Ubuntu, Revolutions, R

2009-10-04 Thread Andrew Choens
For those who don't follow Ubuntu development carefully, the first Beta for the next Ubuntu was recently released, so I took my home system and upgraded to help out with filing bugs, etc. Just to be clear, I am not looking for help with the upgrade process. I've had R, and a few miscellaneous

Re: [R] Welcome to the R-help mailing list

2009-10-04 Thread Alexandre Serra Barreto
__ 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 commented, minimal, self-contained, reproducible code.

[R] Gaussian Maximum Likelihood Classification

2009-10-04 Thread Alexandre Serra Barreto
__ 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 commented, minimal, self-contained, reproducible code.

Re: [R] split-apply question

2009-10-04 Thread Kavitha Venkatesan
Thanks to everyone for the different suggestions! Very useful. PS: The aggregate function based solution didnt work as-is for me, perhaps it needs some modification? Thanks again, On Fri, Oct 2, 2009 at 1:51 PM, William Dunlap wdun...@tibco.com wrote: -Original Message- From:

Re: [R] Modify base R functions in Rprofile.site

2009-10-04 Thread Yihui Xie
Hi Charlie, Thanks a lot! Your dark voodoo really helps! And also, thanks so much to Duncan for your detailed explanation! Finally I used Charlie's trick to modify makeRweaveLatexCoderunner(), and has left parse() deparse() untouched. Regards, Yihui -- Yihui Xie xieyi...@gmail.com Phone:

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

2009-10-04 Thread stephen sefick
Thanks for the help - this was my goal sorry for not being straight forward enough #021973269 is the Waynesboro Gauge on the Savannah River Proper (SRS) #02102908 is the Flat Creek Gauge (ftbrfcms) #02133500 is the Drowning Creek (ftbrbmcm) #02341800 is the Upatoi Creek Near Columbus (ftbn)

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

2009-10-04 Thread Patrick Connolly
On Sat, 03-Oct-2009 at 11:35PM -0400, Daniel Malter wrote: | This person has probably mistaken expelsior for excelsior. | | However, be that as it may, I am personally annoyed by your | statement, David, in which you indicate that you believe this to be | an MBA/business school problem,