[R] Create a time-series from cross-sectional data that has each year as a separate column

2010-09-13 Thread Gabriel Bergin
Hi, I have a dataset from ILO, originally in csv-format, that I have read into R. It is cross-sectional time-series data, so I have a bunch of variables and dummy variables that I need to extract data from for the entire time period. However, the years are separated by columns instead of rows, as

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

2010-09-13 Thread Benoit Boulinguiez
Hi all, I'm still seeking for tweaking the appearance of the color legend in a bar goemetry with ggplot2. I can't seem to control the filling of the colour legend squares take this, ggplot(diamonds, aes(clarity, fill=color,colour = cut)) + geom_bar(position = dodge) and I'd need a white

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

2010-09-13 Thread Jim Lemon
On 09/13/2010 06:17 AM, Karl Brand wrote: 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

Re: [R] SOLVED boxplot knowing Q1, Q3, median, upper and lower whisker value

2010-09-13 Thread David A.
Thank you all for your comments. The bxp() function does the trick well! Subject: RE: [R] boxplot knowing Q1, Q3, median,upper and lower whisker value Date: Fri, 10 Sep 2010 11:00:06 -0700 From: wdun...@tibco.com To: dig...@ohsu.edu; dasol...@hotmail.com CC: r-help@r-project.org

[R] How to generate a particular sequence ?

2010-09-13 Thread Feng Li
Dear R, I have a vector, say a = c(1,2,4,5,6,8). Can I generate a vector or array (2-by-3-by-3) of this form c(1,2,1,2,1,2,4,5,4,5,4,5,6,8,6,8,6,8), in which every two elements in a have been repeated twice? I am to stupid today and could not figure this simple question out... Many many thanks!

Re: [R] How to generate a particular sequence ?

2010-09-13 Thread Jim Lemon
On 09/13/2010 07:19 PM, Feng Li wrote: Dear R, I have a vector, say a = c(1,2,4,5,6,8). Can I generate a vector or array (2-by-3-by-3) of this form c(1,2,1,2,1,2,4,5,4,5,4,5,6,8,6,8,6,8), in which every two elements in a have been repeated twice? I am to stupid today and could not figure this

[R] Saveing plot to multiple locations

2010-09-13 Thread Joel
Hi Im trying to save a plot both to a pdf and as just a picture but without success so if someone can help me I would be happy :) my code: require(party) irisct - ctree(Species ~ .,data = iris) data(iris) attach(iris) pdf('/home/joel/Skrivbord/mammamu.pdf')

Re: [R] How to generate a particular sequence ?

2010-09-13 Thread Ted Harding
On 13-Sep-10 09:19:21, Feng Li wrote: Dear R, I have a vector, say a = c(1,2,4,5,6,8). Can I generate a vector or array (2-by-3-by-3) of this form c(1,2,1,2,1,2,4,5,4,5,4,5,6,8,6,8,6,8) in which every two elements in a have been repeated twice? I am to stupid today and could not figure

Re: [R] How to generate a particular sequence ?

2010-09-13 Thread Keith Jewell
Ted Harding ted.hard...@manchester.ac.uk wrote in message news:xfmail.100913104250.ted.hard...@manchester.ac.uk... On 13-Sep-10 09:19:21, Feng Li wrote: Dear R, I have a vector, say a = c(1,2,4,5,6,8). Can I generate a vector or array (2-by-3-by-3) of this form

Re: [R] update and rebuild all?

2010-09-13 Thread Uwe Ligges
update.packages(checkBuilt=TRUE) Uwe Ligges On 24.08.2010 11:08, Giovanni Azua wrote: Hello, I upgraded my Mac R version to the newest 2.11.1, then I ran the option to update all packages but there was an error related to fetching one of those and the process stopped. I retried updating

Re: [R] R cannot be started

2010-09-13 Thread Uwe Ligges
On 07.09.2010 18:53, Tao wrote: I used Rtools for installing a package under Windows XP. I used commands like R CMD INSTALL (build, check) in the CMD window. It worked well until I found that my revised package can be updated with R CMD INSTALL. After I restarted my computer, R cannot be

[R] SF-36 questionnaire scoring for R?

2010-09-13 Thread Dieter Menne
Dear useRs from the physiology department, Does someone know of an implementation of the SF-36 questionnaire scoring in R? I only found SAS and STATA versions, e.g http://gim.med.ucla.edu/FacultyPages/Hays/util.htm Dieter __ R-help@r-project.org

Re: [R] How to generate a particular sequence ?

2010-09-13 Thread Feng Li
Sorry. It was my typo. Should be three times as it in the example. Feng On Mon, Sep 13, 2010 at 11:32 AM, Jim Lemon j...@bitwrit.com.au wrote: On 09/13/2010 07:19 PM, Feng Li wrote: Dear R, I have a vector, say a = c(1,2,4,5,6,8). Can I generate a vector or array (2-by-3-by-3) of this

[R] Line integral with R

2010-09-13 Thread Alaios
Hello. I would like to calculate with R the weighted line integral of a loss field. Where should I start searching about weighted integration in R? I would like to thank you in advance for your help Best Regards Alex [[alternative HTML version deleted]]

Re: [R] How to generate a particular sequence ?

2010-09-13 Thread Feng Li
Thanks. That's what I want. Sorry for the typo:) Feng On Mon, Sep 13, 2010 at 11:42 AM, Ted Harding ted.hard...@manchester.ac.ukwrote: On 13-Sep-10 09:19:21, Feng Li wrote: Dear R, I have a vector, say a = c(1,2,4,5,6,8). Can I generate a vector or array (2-by-3-by-3) of this form

[R] Need to have more control on cat()

2010-09-13 Thread Christofer Bogaso
Hi all, here is my small piece of codes: fn1 - function(x = 4) { y - 0 if(y == 0) cat(y value is zero\n) # I intentionally created 2nd line here return(4) } If I run this function I get following fn1() y value is zero [1] 4 Here you see

Re: [R] SF-36 questionnaire scoring for R?

2010-09-13 Thread Barry Rowlingson
On Mon, Sep 13, 2010 at 11:16 AM, Dieter Menne dieter.me...@menne-biomed.de wrote: Dear useRs from the physiology department, Does someone know of an implementation of the SF-36 questionnaire scoring in R? I only found SAS and STATA versions, e.g

Re: [R] Need to have more control on cat()

2010-09-13 Thread Barry Rowlingson
On Mon, Sep 13, 2010 at 11:53 AM, Christofer Bogaso bogaso.christo...@gmail.com wrote: Hi all, here is my small piece of codes: fn1 - function(x = 4) {    y - 0    if(y == 0) cat(y value                    is zero\n) # I intentionally created 2nd line here    return(4) } If I run this

Re: [R] Need to have more control on cat()

2010-09-13 Thread Christofer Bogaso
Thanks Barry, I agree it will work. But this approach destroys the indent in the program body therefore entire body of program looks messy, for example cat(Here I put indent) obviously looks better for someone who reads my code, than cat(Here I dont put indent) Any better approach? On

Re: [R] Saveing plot to multiple locations

2010-09-13 Thread Paul Hiemstra
On 09/13/2010 11:32 AM, Joel wrote: Hi Im trying to save a plot both to a pdf and as just a picture but without success so if someone can help me I would be happy :) The problem is that the plot goes only to one graphics device, the last one you defined. Just make the plot twice:

Re: [R] Need to have more control on cat()

2010-09-13 Thread Barry Rowlingson
On Mon, Sep 13, 2010 at 12:11 PM, Christofer Bogaso bogaso.christo...@gmail.com wrote: Thanks Barry, I agree it will work. But this approach destroys the indent in the program body therefore entire body of program looks messy, for example cat(Here I        put indent) obviously looks

Re: [R] SF-8 (not 36) questionnaire scoring for R?

2010-09-13 Thread Dieter Menne
Barry Rowlingson wrote: * SAS CODE FOR SCORING 36-ITEM HEALTH SURVEY 1.0 ... Thanks, Barry, but there was a mistake from my side: I am looking for SF-8. Anyone else? Google was not successful for me Dieter -- View this message in context:

[R] Adding dummy variable zero/one in ARIMA model in R

2010-09-13 Thread Mangalani Peter Makananisa
Dear R gurus, How do I add dummy variable zero/ one in the ARIMA model both in the in-sample and outside the sample(forecasts)? Regards Peter South Africa Tell: +2712 422 7357 Please Note: This email and its contents are subject to our email legal notice which can be viewed

[R] sum to infinity

2010-09-13 Thread tuggi
hello, can i calculate a sum to infinity in R. i want to do something like this: \sum_{i=0}^\infty \frac{2^{-d-1}}{\Gamma(\frac{d-1}{2})}\left(\frac{\Gamma(2d-3)(2-d)_{i}\Gamma(i+1,-z/2)2^{i+1}}{\Gamma(d-1)(4-2d)_{i}i!}\right)+ \\ \sum_{i=0}^\infty

[R] Help with ugarchspec function

2010-09-13 Thread Priyesh Jaipuriar
Hi I am using the ugarchspec function from the rgarch package to fit a mean variance model jointly. Following is the code I'm using: spec = ugarchspec(variance.model = list(model=eGARCH, garchOrder=c(1,1)), mean.model = list(armaOrder=c(1,1))) On doing this, I get the following error: Error

[R] Block other mails

2010-09-13 Thread Charlotte . Ndiribe
Dear Sir or Madam, I was trying to log back on to change my details, I want to stop receiving other user's problems/solutions into my inbox. Yours sincerely, Charlotte Ndiribe __ R-help@r-project.org mailing list

Re: [R] Overlay of two graphs of different axes

2010-09-13 Thread David Winsemius
On Sep 13, 2010, at 1:54 AM, Uwe Dippel wrote: 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. The different axes could be a problem but if you construct both with predefined

Re: [R] Create a time-series from cross-sectional data that has each year as a separate column

2010-09-13 Thread David Winsemius
On Sep 13, 2010, at 2:31 AM, Gabriel Bergin wrote: Hi, I have a dataset from ILO, originally in csv-format, that I have read into R. It is cross-sectional time-series data, so I have a bunch of variables and dummy variables that I need to extract data from for the entire time period.

Re: [R] Saveing plot to multiple locations

2010-09-13 Thread David Winsemius
On Sep 13, 2010, at 5:32 AM, Joel wrote: Hi Im trying to save a plot both to a pdf and as just a picture but without success so if someone can help me I would be happy :) Are you trying to embed a png file in a graphic or do you just want two different files? If the first (obviously

[R] print matrix values and if statement

2010-09-13 Thread Alaios
Hello everyone, I have a 2x2 matrix filled with zeros and some more values around zeros. I would like to print only the non-zero values and to keep the coords of the places that the values are not zero. Could you please help me with that? I would like to thank you in advance for your help

[R] shade area between 'ablines'

2010-09-13 Thread threshold
Hi, want to shade the area between dotted lines: x=c(1,5);y=c(1,5) plot(y~x, type='n') abline(v=c(2,3), lty=2) sometnig simple needed. tried with polygon thx, robert -- View this message in context: http://r.789695.n4.nabble.com/shade-area-between-ablines-tp2537352p2537352.html Sent

[R] lattice: Set x-axis in italics only

2010-09-13 Thread Alejo C.S.
Dear list, I making some box-and-whisker plots in R with vertebrate data. The x axis are species names that must be in italics. I tried with the axis function but no luck, and it seems that affects both axes. Any tip? Thanks a lot in Advance. Alej __

Re: [R] shade area between 'ablines'

2010-09-13 Thread jim holtman
Try this getting the limits of the plot area: x=c(1,5);y=c(1,5) plot(y~x, type='n') abline(v=c(2,3), lty=2) usr - par('usr') usr [1] 0.84 5.16 0.84 5.16 rect(2, usr[3], 3, usr[4], col='green') On Mon, Sep 13, 2010 at 8:45 AM, threshold r.kozar...@gmail.com wrote: Hi, want to shade the

Re: [R] print matrix values and if statement

2010-09-13 Thread jim holtman
Here is how to get the indices of the non-zero values. You can determine how you want to print them x - rbind(c(1,0), c(0,3)) # get indices of non-zero which(x != 0, arr.ind=TRUE) row col [1,] 1 1 [2,] 2 2 possible ways of printing: x.1[x.1 == 0] - NA x.1 [,1] [,2] [1,]

Re: [R] problems with siar package

2010-09-13 Thread Uwe Ligges
Please report to the siar package maintainer (including the package version of siar you are using). Best, Uwe Ligges On 08.09.2010 00:36, Julio Lucio Lancelotti wrote: Hi, my name is Julio, I'm trying to run a script, specifically with the siar package on R (I have attached the script) but

Re: [R] problem after repackaging

2010-09-13 Thread Uwe Ligges
On 28.08.2010 11:07, Samy Khezami wrote: Hy, I had a mistake on a function of a package i have created! I have solved it and then i repackaged and installed the modified package. Probably you installed the modified package into a diferent location from the location that is used in Excel.

Re: [R] Saveing plot to multiple locations

2010-09-13 Thread Joel
Thx for all the help! Dave: Its the second ones so now it looks like this and works but its abit ugly as you have to plot the same thing two times but dossent seem to be any other way or? try(png('/home/joel/Skrivbord/mammamu2.png')) plot(irisct) dev.off()

Re: [R] SF-8 (not 36) questionnaire scoring for R?

2010-09-13 Thread Frank Harrell
I know someone who has R code for SF-36 and perhaps SF-12. Aren't there copyright issues relating to SF-* even if it is reprogrammed? Frank - Frank Harrell Department of Biostatistics, Vanderbilt University -- View this message in context:

Re: [R] SF-8 (not 36) questionnaire scoring for R?

2010-09-13 Thread Marc Schwartz
On Sep 13, 2010, at 8:13 AM, Frank Harrell wrote: I know someone who has R code for SF-36 and perhaps SF-12. Aren't there copyright issues relating to SF-* even if it is reprogrammed? Frank Yep...

Re: [R] lattice: Set x-axis in italics only

2010-09-13 Thread Duncan Mackay
Hi You may need to investigate ?plotmath and ?expression for the italics or possibly add a font=... somewhere Sorry cannot be more help it is too late here Duncan Duncan Mackay Department of Agronomy and Soil Science University of New England ARMIDALE NSW 2351 Email home:

Re: [R] Extracting elements from list: Is [[ always faster than $ ??

2010-09-13 Thread Uwe Ligges
Yes: $() has to calculate more on matching the names --- and is more of a hack anyway. Although, I would not worry to much about 0.3 seconds in 100 evaluations ... Uwe On 08.09.2010 14:31, Søren Højsgaard wrote: Dear list It seems to me that extracting elements from a list using '[['

[R] working version r-2.11.1-win 32.exe

2010-09-13 Thread Molecular Diagnostic Center IPEE RAS
Dear authors!  Could you specify the WEB page on which there is a working version of R-2.11.1 for windows vista 32, of 10 I have received files from different servers all were broken. The problem with the file itself r-2.11.1-win 32.exe, as the program for linux from the same websites will

Re: [R] working version r-2.11.1-win 32.exe

2010-09-13 Thread Uwe Ligges
On 13.09.2010 14:30, Molecular Diagnostic Center IPEE RAS wrote: Dear authors! Could you specify the WEB page on which there is a working version of R-2.11.1 for windows vista 32, of 10 I have received files from different servers all were broken. The problem with the file itself r-2.11.1-win

Re: [R] SF-8 (not 36) questionnaire scoring for R?

2010-09-13 Thread Dieter Menne
Frank Harrell wrote: I know someone who has R code for SF-36 and perhaps SF-12. Aren't there copyright issues relating to SF-* even if it is reprogrammed? You are right. I was not aware of this, and I could not believe it first that a company holds the right to use an almost trivial

[R] array of objects

2010-09-13 Thread Alaios
Hello everyone. I would like to create some agents that span over a specific area map.Every agent needs to have its own data structures like one or two matrices and one list. I think that the best way to do this is to create objects and every instance of an object will be used for a single

Re: [R] shade area between 'ablines'

2010-09-13 Thread threshold
Thanks for replying, indeed works. I forgot to mention that I am looking for a 'transparent shading' s.t. the plot symbols are still visible on the shaded area. robert -- View this message in context: http://r.789695.n4.nabble.com/shade-area-between-ablines-tp2537352p2537479.html Sent from the

Re: [R] SF-8 (not 36) questionnaire scoring for R?

2010-09-13 Thread Frank Harrell
Yes the company behind that probably received federal funds for some of the research and has been very careful to minimize their contribution to the community. I didn't understand your parenthetical remark. Frank - Frank Harrell Department of Biostatistics, Vanderbilt University -- View

Re: [R] SF-8 (not 36) questionnaire scoring for R?

2010-09-13 Thread Joshua Wiley
If it's not possible to use their particular algorithms, does anyone think it would be helpful/practical to try to write a general scoring system? I imagine a function with arguments for column names, a list where each element is a vector that indicates the numbers that correspond to various

Re: [R] lattice: Set x-axis in italics only

2010-09-13 Thread David Winsemius
On Sep 13, 2010, at 8:50 AM, Alejo C.S. wrote: Dear list, I making some box-and-whisker plots in R with vertebrate data. The x axis are species names that must be in italics. I tried with the axis function but no luck, and it seems that affects both axes. Any tip? In bwplot just add: ...,

Re: [R] Help on simple problem with optim

2010-09-13 Thread Cristian Montes
Did you check if the data in da has any NA in the dependent or the independent data? Remember that your function llk.mar is going to evaluate dnorm for each pair. If any of those pairs has an NA value, your function will return an NA at the end (sum(c(NA,1,2,3)) = NA) I would check if the

Re: [R] confidence bands for a quasipoisson glm

2010-09-13 Thread Gavin Simpson
On Sat, 2010-09-11 at 14:41 -0700, Peng, C wrote: Is this something you want to have (based on a simulated dataset)? counts - c(18,17,15,20,10,20,25,13,12) #risk - round(rexp(9,0.5),3) risk- c(2.242, 0.113, 1.480, 0.913, 5.795, 0.170, 0.846, 5.240, 0.648) gm - glm(counts ~ risk,

Re: [R] Axis break with gap.plot()

2010-09-13 Thread Filoche
Hi again everyone. Anyone know if there's any limitation with gap.plot concerning the fill color of plotted markers? I would like to fill the circles with a color : library(plotrix); gap.plot(c(1,2,3,4,10), c(1,2,3,4,10), c(5,9), pch = 21, col = red); However, it only change the color of the

Re: [R] shade area between 'ablines'

2010-09-13 Thread jim holtman
check out this link http://finzi.psych.upenn.edu/R/library/seqinr/html/col2alpha.html On Mon, Sep 13, 2010 at 9:58 AM, threshold r.kozar...@gmail.com wrote: Thanks for replying, indeed works. I forgot to mention that I am looking for a 'transparent shading' s.t. the plot symbols are still

Re: [R] shade area between 'ablines'

2010-09-13 Thread Dennis Murphy
Hi: Here's a ggplot2 example: p - ggplot(mtcars, aes(x = wt, y = mpg)) p + geom_rect(xmin = 2, xmax = 3, ymin = 0, ymax = Inf, fill = 'green', alpha = 0.2) + geom_point() + theme_bw() I don't know why the alpha transparency doesn't work in this example, but plotting the points after

Re: [R] Axis break with gap.plot()

2010-09-13 Thread David Winsemius
On Sep 13, 2010, at 10:34 AM, Filoche wrote: Hi again everyone. Anyone know if there's any limitation with gap.plot concerning the fill color of plotted markers? I would like to fill the circles with a color : library(plotrix); gap.plot(c(1,2,3,4,10), c(1,2,3,4,10), c(5,9), pch = 21,

Re: [R] Saving/loading custom R scripts

2010-09-13 Thread DrCJones
I'm still relatively new to R, so I tried the first of you two solutions: .First - function(){ source(Friedman-Test-with-Post-Hoc.r.txt) } Thanks very much for that, it works perfectly Cheers -- View this message in context:

Re: [R] SF-8 (not 36) questionnaire scoring for R?

2010-09-13 Thread Marc Schwartz
On Sep 13, 2010, at 8:59 AM, Joshua Wiley wrote: If it's not possible to use their particular algorithms, does anyone think it would be helpful/practical to try to write a general scoring system? I imagine a function with arguments for column names, a list where each element is a vector

Re: [R] lattice: Set x-axis in italics only

2010-09-13 Thread Dennis Murphy
Hi: demo(graphics) has a lot of nice examples of how to use various features - one of them is font selection. font = 3 = italic font = 4 = bold italic You need to select the correct aspect of the plot, however: font.main, font.sub, font.lab or font.axis (from par()). HTH, Dennis

Re: [R] SF-8 (not 36) questionnaire scoring for R?

2010-09-13 Thread peter dalgaard
On Sep 13, 2010, at 15:59 , Joshua Wiley wrote: If it's not possible to use their particular algorithms, does anyone think it would be helpful/practical to try to write a general scoring system? I imagine a function with arguments for column names, a list where each element is a vector that

Re: [R] Plotting multiple edges with iGraph

2010-09-13 Thread sashaBsAs
Thanks Gábor! -- View this message in context: http://r.789695.n4.nabble.com/Plotting-multiple-edges-with-iGraph-tp2527506p2537603.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

[R] Problems with reshape2 on Mac

2010-09-13 Thread Paul Metzner
Hi! I updated to reshape2 yesterday and tried to make it work. Unfortunately, it mainly throws error messages at me (good thing it's reshape2 1.0 and not reshape 2.0). The most recent is: Error in match.fun(FUN) : object 'id' not found When I manually create an object 'id', it says: Error in

[R] Specify a minimum number of valid arguments for the mean function

2010-09-13 Thread Luana Marotta
Hello all, I want to specify a minimum number of valid arguments for the mean function--I have 5 variables but I want the mean only of cases that have at least 3 valid answers. What is the best way to do that? Thank you very much! Luana [[alternative HTML version deleted]]

[R] Sample a vector repeatedly

2010-09-13 Thread James Hudson
I’d like to sample the vector “y” repeatedly. In this dummy dataset, I’d like to sample (and store) it 1, 2, and 3 times. Is there a straightforward way to do this without using a “for” loop? x - c(1 :3) y - c(1:10) (run.sample - sample (y, x)) Thanks very much, James Hudson

Re: [R] Axis break with gap.plot()

2010-09-13 Thread Filoche
Thank you sir. Regards, Phil -- View this message in context: http://r.789695.n4.nabble.com/Axis-break-with-gap-plot-tp2533027p2537660.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

[R] as.Date() add a day to a date

2010-09-13 Thread Andrew Yee
I'm trying to understand why as.Date() is converting a the modified date of a file from August 22 to August 23. foo - file.info(file.to.process) str(foo) 'data.frame': 1 obs. of 10 variables: $ size : num 5.37e+09 $ isdir : logi FALSE $ mode :Class 'octmode' int 436 $ mtime :

Re: [R] SF-8 (not 36) questionnaire scoring for R?

2010-09-13 Thread Joshua Wiley
On Mon, Sep 13, 2010 at 8:02 AM, Marc Schwartz marc_schwa...@me.com wrote: On Sep 13, 2010, at 8:59 AM, Joshua Wiley wrote: If it's not possible to use their particular algorithms, does anyone think it would be helpful/practical to try to write a general scoring system?  I imagine a function

Re: [R] Problems with reshape2 on Mac

2010-09-13 Thread Uwe Ligges
Is this a recent version of R? If so, please report to the maintainer. Otherwise, please also report that it does not work with your version of R so that the maintainer can add a version dependency. Best, Uwe Ligges On 13.09.2010 17:42, Paul Metzner wrote: Hi! I updated to reshape2

Re: [R] as.Date() add a day to a date

2010-09-13 Thread David Winsemius
On Sep 13, 2010, at 11:56 AM, Andrew Yee wrote: I'm trying to understand why as.Date() is converting a the modified date of a file from August 22 to August 23. foo - file.info(file.to.process) str(foo) 'data.frame': 1 obs. of 10 variables: $ size : num 5.37e+09 $ isdir : logi FALSE $

Re: [R] Overlay of two graphs of different axes

2010-09-13 Thread Greg Snow
The zoomplot or updateusr functions in the TeachingDemos package may help. But be cautious, the thing that grabs the most attention is where 2 (or more) lines cross, when you plot multiple lines on different scales the crossing is meaningless, but that meaningless point is what draws the eyes.

Re: [R] Saveing plot to multiple locations

2010-09-13 Thread Greg Snow
?dev.copy -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- project.org] On Behalf Of Joel Sent: Monday, September 13, 2010 7:13 AM To:

Re: [R] sum to infinity

2010-09-13 Thread David Winsemius
On Sep 13, 2010, at 5:24 AM, tuggi wrote: hello, can i calculate a sum to infinity in R. i want to do something like this: \sum_{i=0}^\infty \frac{2^{-d-1}}{\Gamma(\frac{d-1}{2})}\left(\frac{\Gamma(2d-3)(2- d)_{i}\Gamma(i+1,-z/2)2^{i+1}}{\Gamma(d-1)(4-2d)_{i}i!}\right)+ \\

Re: [R] How to do a trig regression

2010-09-13 Thread Greg Snow
Without the square term you can just use the rule for addition in sines: sin(a+b) = sin(a)cos(b) + cos(a)sin(b) So a regression of y= a + b* sin(2*pi/360*x + c) can be fit as: lm( y~ sin( 2*pi/360*x) + cos( 2*pi/360/x ) ) If you need the actual values of b and c then you will need to do a

Re: [R] Sample a vector repeatedly

2010-09-13 Thread Marc Schwartz
On Sep 13, 2010, at 10:30 AM, James Hudson wrote: I‚d like to sample the vector „y‰ repeatedly. In this dummy dataset, I‚d like to sample (and store) it 1, 2, and 3 times. Is there a straightforward way to do this without using a „for‰ loop? x - c(1 :3) y - c(1:10) (run.sample -

[R] R 2.12.0 scheduled for October 15

2010-09-13 Thread peter dalgaard
This is to announce that we plan to release R version 2.12.0 on Friday, October, 2010. Those directly involved should review the generic schedule at http://developer.r-project.org/release-checklist.html The source tarballs will be made available daily (barring build troubles) via

Re: [R] as.Date() add a day to a date

2010-09-13 Thread Andrew Yee
Thanks David, now I wonder how you can have as.Date() render the date using local time rather than UTC. Andrew On Mon, Sep 13, 2010 at 12:08 PM, David Winsemius dwinsem...@comcast.netwrote: On Sep 13, 2010, at 11:56 AM, Andrew Yee wrote: I'm trying to understand why as.Date() is converting

[R] R 2.12.0 scheduled for October 15

2010-09-13 Thread Peter Dalgaard
This is to announce that we plan to release R version 2.12.0 on Friday, October 15, 2010. Those directly involved should review the generic schedule at http://developer.r-project.org/release-checklist.html The source tarballs will be made available daily (barring build troubles) via

Re: [R] Sample a vector repeatedly

2010-09-13 Thread James Hudson
Thank you Marc - the first scenario. On Mon, Sep 13, 2010 at 2:04 PM, Marc Schwartz marc_schwa...@me.com wrote: On Sep 13, 2010, at 10:30 AM, James Hudson wrote: I‚d like to sample the vector „y‰ repeatedly. In this dummy dataset, I‚d like to sample (and store) it 1, 2, and

Re: [R] reshape matrix entities to columns

2010-09-13 Thread Natasha Asar
thanks for your help I am trying to work around this in R but i have the feeling that this is going to but the center and age next to each other which is not what i need... it might be me not being able to find my head around this but... i need a table with age as columns and center as rows if

Re: [R] Sample a vector repeatedly

2010-09-13 Thread Henrique Dallazuanna
You can try this also: Vectorize(sample, 'size')(y, 1:3) On Mon, Sep 13, 2010 at 12:30 PM, James Hudson jmghud...@gmail.com wrote: I’d like to sample the vector “y” repeatedly. In this dummy dataset, I’d like to sample (and store) it 1, 2, and 3 times. Is there a straightforward way to do

Re: [R] as.Date() add a day to a date

2010-09-13 Thread David Winsemius
On Sep 13, 2010, at 1:24 PM, Andrew Yee wrote: Thanks David, now I wonder how you can have as.Date() render the date using local time rather than UTC. Since we are both in the EDT TZ at the moment, our times are UTC-4 (hours = 60*60 seconds) dt - as.POSIXct(2010-08-22 23:14:52)

Re: [R] as.Date() add a day to a date

2010-09-13 Thread Andrew Yee
Henrique, thanks for your suggestion. For my applications, character would have been sufficient, so your suggestion of using format() works fine too. Perhaps I should submit a feature request for as.Date() to let you specify local time. Thanks, Andrew On Mon, Sep 13, 2010 at 2:06 PM, Henrique

[R] Transforming character vector

2010-09-13 Thread LCOG1
Hi guys, Cant seem to find a solution for this. I am looking for a substitute for cut that can transform character vectors. So as cut would be used below to transform YearCat- YearCat2 base on Year and vector Ag-c(00-'70,'71-'75,'76-'85,'86-'09) using 'cut '

Re: [R] as.Date() add a day to a date

2010-09-13 Thread David Winsemius
Try this: format(dt, '%Y-%m-%d'), if you want Date class: as.Date(format(dt, '%Y-%m-%d')) On Mon, Sep 13, 2010 at 2:24 PM, Andrew Yee y...@post.harvard.edu wrote: Thanks David, now I wonder how you can have as.Date() render the date using local time rather than UTC. Andrew On Mon,

[R] using survexp and ratetable with coxph object that includes a factor term

2010-09-13 Thread Erik Iverson
Hello, I'm attempting to use the ratetable argument to survexp in the survival package. I use the example from the ?survexp help page below, and then slightly modify it to produce an error. library(survival) data(pbc) #fit a model without any factors pfit1 - coxph(Surv(time, status 0) ~ trt

[R] [R-pkgs] New version of rms package on CRAN

2010-09-13 Thread Frank Harrell
CRAN has a significant update to rms. Windows and unix/linux versions are available and I expect the Mac version to be available soon. The most significant improvement is addition of latex=TRUE arguments to model fitting print methods, made especially for use with Sweave. Here is a summary

[R] list with explanation for trellis parameters available?

2010-09-13 Thread Jannis
Dears, does anyone know whether there is any complete list with explanations for the several Trellis parameters (i.e. the ones you one gets with trellis.par.set() ) available? Many of them are self explanatory or easy to guess but there is such a vast amount of them that this is not possible

Re: [R] Transforming character vector

2010-09-13 Thread Ben Bolker
LCOG1 jroll at lcog.org writes: [snip] I need to do the same for a fueltype where each record has a character representing the data instead of a numeral(as in year). No reproducible code or data because i think this is pretty straight forward. I could do this using a series of loops but

Re: [R] Problems with reshape2 on Mac

2010-09-13 Thread Hadley Wickham
Hi Uwe, The problem is most likely because the original poster doesn't have the latest version of plyr. I correctly declare this dependency in the DESCRIPTION (http://cran.r-project.org/web/packages/reshape2/index.html), but unfortunately R doesn't seem to use this information at run time,

[R] The future of R - Ross Ihaka stirs discussions around the web

2010-09-13 Thread Tal Galili
Hello all, There is currently a (very !) lively discussions happening around the web, surrounding the following topics: 1) Is R efficient? (scripting wise, and performance wise) 2) Should R be written from scratch? 3) What should be the license of R (if it was made a new)? Very serious people

[R] How to tell R that ABC is the name of a dataset not a variable value

2010-09-13 Thread Jie Li
All, For example, I have a dataset named ABC loaded into R ABC [,1] [,2] [,3] [1,]147 [2,]258 [3,]369 and I also have a variable datasetname datasetname [1] ABC and I want to add this ABC dataset to an existing list alldata alldata -NULL alldata -

[R] Question: Form a new list with the index replicated equal to the number of elements in that index

2010-09-13 Thread Sunny Srivastava
Dear R-Helpers, I have a list l1 like: l1[[1]] a b c l1[[2]] d l1[[3]] e f I want an output res like: res[[1]] 1 1 1 res[[2]] 2 res[[3]] 3 3 Essentially, I want to replicate each index equal to the number of elements present in that index. Below is what I do to accomplish this: l1 -

Re: [R] How to tell R that ABC is the name of a dataset not a variable value

2010-09-13 Thread Henrique Dallazuanna
Se ?get function. On Mon, Sep 13, 2010 at 3:40 PM, Jie Li ruser...@gmail.com wrote: All, For example, I have a dataset named ABC loaded into R ABC [,1] [,2] [,3] [1,]147 [2,]258 [3,]369 and I also have a variable datasetname datasetname [1]

[R] Transparent Labels for Polar Plot

2010-09-13 Thread James MacCarthy
Hello, I am currently using the polar.plot function in the plotrix package to graph data. Unfortunately, it seems that the default for the labels is to have a background color that is covering the line representing my data, making it difficult to read. Is there a way to make this label

Re: [R] How to tell R that ABC is the name of a dataset not a variable value

2010-09-13 Thread Joshua Wiley
Hi, Just to provide an example: #Sample data copied to variables X, Y, and Z Z - Y - X - data.frame(A = 1:10) # A variable holding the names of the variables datasetname - c(X, Y, Z) # Use mget() to collect all the variables in a list # get() only gets one variable at a t ime, mget() gets

Re: [R] lattice: Set x-axis in italics only

2010-09-13 Thread Alejo C.S.
Thanks all for the excellent help! Kind regards, Alej 2010/9/13 Dennis Murphy djmu...@gmail.com: Hi: demo(graphics) has a lot of nice examples of how to use various features - one of them is font selection. font = 3  = italic  font = 4 = bold italic You need to select the

[R] Dampening the spline interpolation for contours

2010-09-13 Thread Craig Stanton
Hello all, I'm very new to R and am having some trouble with the results of the interp function. I'm trying to produce a chart roughly akin to a weather map with natural looking filled contours over a large region of the south pacific. I've got a list of points and values to be mapped

Re: [R] Question: Form a new list with the index replicated equal to the number of elements in that index

2010-09-13 Thread Phil Spector
Sunny - I don't think mapply is needed: lapply(1:length(mylist),function(x)rep(x,length(mylist[[x]]))) [[1]] [1] 1 1 1 [[2]] [1] 2 [[3]] [1] 3 3 - Phil Spector Statistical Computing Facility

Re: [R] Dampening the spline interpolation for contours

2010-09-13 Thread Dylan Beaudette
Although not an R solution, I would highly recommend the generic mapping tools GMT for this type of work. http://gmt.soest.hawaii.edu/ Cheers, Dylan On Monday 13 September 2010, Craig Stanton wrote: Hello all, I'm very new to R and am having some trouble with the results of the interp

Re: [R] The future of R - Ross Ihaka stirs discussions around the web

2010-09-13 Thread Albyn Jones
There was an award session at the Vancouver JSM where both Ross Ihaka and Robert Gentleman spoke. The simply-start-over post sounds very much like Ross's JSM talk. Robert's response was much more positive - coming from the perspective of developing BioConductor I think. I don't recall the

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

2010-09-13 Thread Liviu Andronic
Hello On Sun, Sep 12, 2010 at 5:37 PM, Sebastian Gibb li...@sebastiangibb.de wrote: Hello, thanks for your answer. mapply fits to my needs. One thing that seems strange is that if you use tree[[1]]$node$values - 1:10 tree[[2]]$node$values - 3:12 you still get mapply(mean,

  1   2   >