Re: [R] truncating values into separate categories

2009-08-01 Thread PDXRugger
I must apoligize, as i want clear of what i wanted to occur. i dont want to count the occurences but rather recode them. I am trying to replace all of the values with the new coded values in Person_CAT. SO NP - c(1, 1, 2, 1, 1, 2, 2, 1, 4, 1, 0, 5, + 3, 3, 1, 5, 3, 5, 1, 6, 1,

[R] superpose 2 time series with different time intervals

2009-08-01 Thread Gary Lewis
I could use some advice. I've got 2 time series. Both cover approximately the same period of time (ie, 1940 to 2009). But one series has annual data and the other has monthly data. One refers to university enrollment; the other to unemployment rates. Both are currently in the same data frame.

[R] how to calculate time interval between dates

2009-08-01 Thread liujb
Dear R users: I have a vector of dates as follows: t - c(2007-01-05, 2007-05-14, 2007-12-28, 2008-01-09, 2008-04-24, 2009-02-14) I'd like to calculate number of days between those dates (time interval). How to do it? Thank you, Julia -- View this message in context:

Re: [R] another automation question

2009-08-01 Thread Mehdi Khan
your name is annoying. On Fri, Jul 31, 2009 at 2:01 PM, RR! cwal...@usgs.gov wrote: This code works: x-letters[1:6] ycols-23:28 xcols-rep(c(3,4,5,8),each=length(ycols)) somertime-function(i,j)somers2(Pred_pres_a_indpdt[,i,,], population[,j]) results-mapply(somertime,xcols,ycols)

[R] re moving intial numerals

2009-08-01 Thread PDXRugger
I would like to recreate data so that only the last 5 digits of the below data are inlcuded as data so 200502019 would become 02019. Any ideas. data=c(200500735, 200502019, 200504131, 200504217, 200504629, 200504822, 200510115, 200511605, 200514477,

Re: [R] Compare lm() to glm(family=poisson)

2009-08-01 Thread Ken Knoblauch
Mark Na mtb954 at gmail.com writes: Dear R-helpers, I would like to compare the fit of two models, one of which I fit using lm() and the other using glm(family=poisson). The latter doesn't provide r-squared, so I wonder how to go about comparing these models (they have the same formula).

Re: [R] superpose 2 time series with different time intervals

2009-08-01 Thread Gabor Grothendieck
Try this: # two simulated series set.seed(123) ts.sim - arima.sim(list(order = c(1,1,0), ar = 0.7), n = 70) ts.sim - ts(c(ts.sim), start = 1940) ts.sim2 - arima.sim(list(order = c(1,1,0), ar = 0.7), n = 12*70) ts.sim2 - ts(c(ts.sim2), start = 1940, freq = 12) # plot plot(ts.sim2, type = l, col =

Re: [R] re moving intial numerals

2009-08-01 Thread baptiste auguie
Try this, formatC(d %% 1e5, width=5, flag = 0, mode=integer) [1] 00735 02019 04131 04217 04629 04822 10115 11605 14477 [10] 15314 15438 19040 19603 22735 22853 23415 24227 24423 HTH, baptiste 2009/7/31 PDXRugger j_r...@hotmail.com: I would like to recreate data so that only the last 5

Re: [R] How to stop an R script when running JGR on a Linux/SuSE system

2009-08-01 Thread Bernd Kreuss
mau...@alice.it wrote: I wonder whether there is a more gentle way to stop an R script running on top of JGR aother than ... unplugging the power cord. there must be a bug in JGR on Lunux. Clicking the stop button should stop the script, clicking it here on my linux machine will immediately

Re: [R] How to stop an R script when running JGR on a Linux/SuSE system

2009-08-01 Thread Bernd Kreuss
sorry for the eventual double posting, but i got a strange error from a versatel(???) server about not enough quota when replying to the message __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] R User Group listings

2009-08-01 Thread Friedrich Leisch
On Fri, 31 Jul 2009 06:45:38 -0400, Prof John C Nash (PJCN) wrote: Further to my posting about R UG mailing lists etc., and David Smith's post about the list he is maintaining (I was aware of his blog, but not that he was updating -- good show), I'm in communication with him to try

Re: [R] Problem with RGtk2 Rattle

2009-08-01 Thread Wayne Murray
HI Thanks for all the advice, unfortunately I am unable to install the suggested fix - error message as follows: Error in gzfile(file, r) : cannot open the connection In addition: Warning message: In gzfile(file, r) : cannot open compressed file 'glade-3.4.3-win32-1/DESCRIPTION', probable

Re: [R] Using R with Hadoop/Hive for Big Data

2009-08-01 Thread Ajay ohri
Hi, The document helps a lot thanks. I need to know how to work with Hadoop and R in a parallel clsuter environment. HIVE is a new system on top of Hadoop that uses a SQL derivative to query it. http://hadoop.apache.org/hive/ Regards, Ajay On Fri, Jul 31, 2009 at 7:23 PM, Avram Aelony

Re: [R] how to calculate time interval between dates

2009-08-01 Thread David Winsemius
On Jul 31, 2009, at 4:46 PM, liujb wrote: Dear R users: I have a vector of dates as follows: t - c(2007-01-05, 2007-05-14, 2007-12-28, 2008-01-09, 2008-04-24, 2009-02-14) I'd like to calculate number of days between those dates (time interval). How to do it? That is not a vector of

Re: [R] R User Group listings

2009-08-01 Thread Prof. John C Nash
Why not! Looks like there were several conversations going on independently at UseR about this. I'll put up a page and then ask Martin to adjust the link. JN Friedrich Leisch wrote: On Fri, 31 Jul 2009 06:45:38 -0400, Prof John C Nash (PJCN) wrote: Further to my posting about R UG

Re: [R] How to stop an R script when running JGR on a Linux/SuSE system

2009-08-01 Thread Peter Dalgaard
Bernd Kreuss wrote: sorry for the eventual double posting, but i got a strange error from a versatel(???) server about not enough quota when replying to the message Yes, I had one of those too (see below), but notice that the error occurs after the mail has left the mailing list server at

[R] R book for economists

2009-08-01 Thread Thiemo Fetzer
Dear Group, I am an economics student starting with PhD work in London. As preparation I would like to get to know R a little bit better. For Stata there are tons of books, however, can you recommend a book for R? I have some substantiated econometrics knowledge, so it should be more a how-to

Re: [R] R User Group listings

2009-08-01 Thread Prof. John C Nash
Better ideas should prevail. There is now a wiki page at http://wiki.r-project.org/rwiki/doku.php?id=rugs:r_user_groups. It is not yet fully populated. (David Smith's blog at REvolution Computing mentions more groups.) JN __ R-help@r-project.org

Re: [R] about the summary(cph.object)

2009-08-01 Thread David Winsemius
On Jul 31, 2009, at 11:24 PM, zhu yao wrote: Could someone explain the summary(cph.object)? The example is in the help file of cph. n - 1000 set.seed(731) age - 50 + 12*rnorm(n) label(age) - Age sex - factor(sample(c('Male','Female'), n, rep=TRUE, prob=c(.6, .4))) cens -

Re: [R] Problem with RGtk2 Rattle

2009-08-01 Thread Felix Andrews
Um, it sounds as if you are trying to install glade-3.4.3-win32.zip into R as a package... but it is not an R package!! GTK+/Glade is a system library to be installed into Windows. You should download the .exe (not the .zip) http://downloads.sourceforge.net/gladewin32/gtk-dev-2.12.9-win32-2.exe

Re: [R] R book for economists

2009-08-01 Thread Ronggui Huang
How about Kleiber, C. Zeileis, A. Applied Econometrics with R Springer, 2008? Ronggui 2009/8/1 Thiemo Fetzer t...@devmag.net: Dear Group, I am an economics student starting with PhD work in London. As preparation I would like to get to know R a little bit better. For Stata there are tons of

Re: [R] truncating values into separate categories

2009-08-01 Thread David Winsemius
On Jul 31, 2009, at 2:55 PM, PDXRugger wrote: I must apoligize, as i want clear of what i wanted to occur. i dont want to count the occurences but rather recode them. I am trying to replace all of the values with the new coded values in Person_CAT. SO NP - c(1, 1, 2, 1, 1, 2, 2,

Re: [R] R book for economists

2009-08-01 Thread Achim Zeileis
On Sat, 1 Aug 2009, Thiemo Fetzer wrote: Dear Group, I am an economics student starting with PhD work in London. As preparation I would like to get to know R a little bit better. For Stata there are tons of books, however, can you recommend a book for R? Of course, I have to recommend our

Re: [R] SVG output on Windows OS

2009-08-01 Thread David Winsemius
On Jul 31, 2009, at 6:41 PM, Michael Roessler wrote: How may one save a graphic as svg on Windows? The svg() command is recognized and functions well on Linux, etc., but not on Windows, it seems. I'm trying to use Hadley Wickam's ggplot2 and I would like to be able to save created charts

Re: [R] Problem with RGtk2 Rattle

2009-08-01 Thread Graham Williams
2009/8/1 Felix Andrews fe...@nfrac.org Um, it sounds as if you are trying to install glade-3.4.3-win32.zip into R as a package... but it is not an R package!! GTK+/Glade is a system library to be installed into Windows. You should download the .exe (not the .zip)

[R] Add columns in a dataframe and fill them from another table according to a criteria

2009-08-01 Thread Meenu Sahi
Deare R users I am new to R. What I want to do is explained below;- I have table called States.Prob which is given below:- This table gives the probabilities of the changes in the swap curve depending on the state of the swap curve. I want to put these probabilities in my dataframe mydata(given

[R] xyplot: superpose 2 time series with different time intervals

2009-08-01 Thread Gary Lewis
I could use some advice regarding xyplot. I've got 2 time series. Both cover approximately the same period of time (ie, 1940 to 2009). But one series has annual data and the other has monthly data. One refers to university enrollment; the other to unemployment rates. Both are currently in the

Re: [R] xyplot: superpose 2 time series with different time intervals

2009-08-01 Thread Gabor Grothendieck
Try this using the same ts.sim and ts.sim2 from my previous post. https://stat.ethz.ch/pipermail/r-help/2009-August/206697.html library(zoo) library(lattice) plot(na.approx(cbind(as.zoo(ts.sim), as.zoo(ts.sim2))), screen = 1, col = c(black, grey(0.5))) On Sat, Aug 1, 2009 at 10:26 AM,

Re: [R] Determine the dimension-names of an element in an array in R

2009-08-01 Thread Sauvik De
Hi Christian: Many thank for the code. But I am afraid that your code still has a problem in terms of providing correct correlation. For example, if you look at the correlation between DataArray_1[A2,B1,D1,] and DataArray_2[A2,C1,D1,] after running your code, you will notice that this is

Re: [R] xyplot: superpose 2 time series with different time intervals

2009-08-01 Thread Gabor Grothendieck
In the last statement you can replace plot with xyplot (although both work). On Sat, Aug 1, 2009 at 10:37 AM, Gabor Grothendieckggrothendi...@gmail.com wrote: Try this using the same ts.sim and ts.sim2 from my previous post. https://stat.ethz.ch/pipermail/r-help/2009-August/206697.html

[R] Variable alias

2009-08-01 Thread Daniel Haase
Hi Everyone, is there the possibility in R to assign a variable to be an alias of another one? Example: x - 17 # assign y to be an alias of x y # returns 17 x - 4 y # returns 4 Daniel __ R-help@r-project.org mailing list

Re: [R] Variable alias

2009-08-01 Thread Henrique Dallazuanna
You can assign the x variable like this: y - x - 17 y - x - 4 On Sat, Aug 1, 2009 at 11:55 AM, Daniel Haase d...@haase-zm.de wrote: Hi Everyone, is there the possibility in R to assign a variable to be an alias of another one? Example: x - 17 # assign y to be an alias of x y #

[R] zoo plot warning messages - I don't know what they mean or how to inspect the data to figure this out

2009-08-01 Thread stephen sefick
I have a time series from 1933-2005 of precipitation at Fayetteville NC. I get the following error messages when I plot the zoo series. Any help would be appreciated. If you need the data I can dput it or send the csv. I didn't include it here because I didn't want to clog up anybodies email

Re: [R] Add columns in a dataframe and fill them from another table according to a criteria

2009-08-01 Thread David Winsemius
On Aug 1, 2009, at 9:52 AM, Meenu Sahi wrote: Deare R users I am new to R. What I want to do is explained below;- I have table called States.Prob which is given below:- This table gives the probabilities of the changes in the swap curve depending on the state of the swap curve. I want to put

Re: [R] Variable alias

2009-08-01 Thread Gabor Grothendieck
If you only have to use y once then you can use delayedAssign. This will assign a promise and the promise will not be evaluated until its used: x Error: object 'x' not found y Error: object 'y' not found x - y x - 1 delayedAssign(y, x) x - 2 y [1] 2 If that's not good enough you can use

Re: [R] Displaying function arguments using a Windows R console

2009-08-01 Thread David Winsemius
On Jul 31, 2009, at 2:35 PM, Laura S. wrote: I am relatively new to R, and would appreciate any suggestions you may have. I noticed on a Mac the functions' arguments are listed at the bottom of the R console. Is it possible to add such a feature to a Windows R console? I have Windows

Re: [R] Determine the dimension-names of an element in an array in R

2009-08-01 Thread Poersching
Hey, oh yes, but now I have realy the ultimate solution... ;-) Here it comes: a= c(A1,A2,A3,A4,A5) b= c(B1,B2,B3) c= c(C1,C2,C3,C4) d= c(D1,D2) e= c(E1,E2,E3,E4,E5,E6,E7,E8) DataArray_1 = array(c(rnorm(240)),dim=c(length(a),length(b), length(d),length(e)),dimnames=list(a,b,d,e)) DataArray_2 =

Re: [R] write matrix M including names(dimnames(M))

2009-08-01 Thread David Winsemius
On Jul 30, 2009, at 11:50 PM, Steve Jaffe wrote: I can do this by writing (and reading) the file according to some format of my own devising, but I'm wondering if there is a built-in way to write and then restore a matrix with not only the dimnames (which write.table/read.table can

Re: [R] xyplot: superpose 2 time series with different time intervals

2009-08-01 Thread Deepayan Sarkar
On Sat, Aug 1, 2009 at 7:26 AM, Gary Lewisgary.m.le...@gmail.com wrote: I could use some advice regarding xyplot. I've got 2 time series. Both cover approximately the same period of time (ie, 1940 to 2009). But one series has annual data and the other has monthly data. One refers to

Re: [R] Parameters of Logistic Distribution and (3 Parameter) Log Logistic Distribution

2009-08-01 Thread David Winsemius
On Jul 31, 2009, at 3:33 AM, Madhavi Bhave wrote: Dear R Helpers Please guide me how one can estimate the parameters of Logistic Distribution and 3 Parameter Log-logistic distribution for a given data. data -

Re: [R] Add columns in a dataframe and fill them from another table according to a criteria

2009-08-01 Thread Meenu Sahi
Dear R users My apologizes for not writing in the correct format due to my ignorance. In the future I will write more clearly. I hope to contribute to the R community in the process of picking up the language professionally. I have now written the R code which is attached in a notepad file. I've

Re: [R] Determine the dimension-names of an element in an array in R

2009-08-01 Thread Sauvik De
Hi Christian: Thanks a lot for your continuous help. This time you got the code right ! That's what I wanted :) Great job! Thanks Regards, Sauvik On Sat, Aug 1, 2009 at 10:30 PM, Poersching poerschin...@web.de wrote: Hey, oh yes, but now I have realy the ultimate solution... ;-) Here it

Re: [R] zoo plot warning messages - I don't know what they mean or how to inspect the data to figure this out

2009-08-01 Thread Gabor Grothendieck
So as not to leave this thread dangling the problem was character fields where numeric fields had been expected. On Sat, Aug 1, 2009 at 11:32 AM, stephen sefickssef...@gmail.com wrote: I have a time series from 1933-2005 of precipitation at Fayetteville NC.  I get the following error messages

Re: [R] Automatic datasets creation from multiple data sheets in a single excel file

2009-08-01 Thread Erich Neuwirth
If you have RExcel (and the necessary infrastructure, i.e. statconnDCOM and possibly rcom) installed, the following VBA macro will do the trick. -=-=-=-=-= Option Explicit Sub TransferAllSheetsAsDataframes(wb As Workbook) Dim ws As Worksheet RInterface.StartRServer For Each ws In

[R] diagonal lda and qda

2009-08-01 Thread cindy Guo
Hi, all, I am wondering if there is any package doing lda and qda which allows assuming diagonal covariance matrices. I checked the lda function in MASS, and it seems it does not support this. Thanks, Cindy [[alternative HTML version deleted]]

[R] diagonal LDA and QDA

2009-08-01 Thread cindy Guo
Hi, all, I am wondering if there is any package doing lda and qda which allows assuming diagonal covariance matrices. I checked the lda function in MASS, and it seems it does not support this. Thanks, Cindy [[alternative HTML version deleted]]

Re: [R] Question about rpart decision trees (being used to predict customer churn)

2009-08-01 Thread Carlos J. Gil Bellosta
Hello, If you do my.tree - rpart(cancel ~ experience) and then you check my.tree$frame you will note that the complexity parameter there is 0. Check ?rpart.object to get a description of what this output means. But essentially, you will not be able to break the leaf unless you set a

[R] Transparency and trellis device

2009-08-01 Thread pomchip
Dear R-users, I am trying to produce trellis (png, or jpeg) graphs with transparent background, but I cannot manage to make that happen. I tried to play around with themes but to no avail. Any advise on the following example will be greatly appreciated: Thank you Sebastien

[R] diagonal LDA and QDA

2009-08-01 Thread cindy Guo
Hi, all, I am wondering if there is any package doing lda and qda which allows assuming diagonal covariance matrices. I checked the lda function in MASS, and it seems it does not support this. Thanks, Cindy [[alternative HTML version deleted]]

Re: [R] How to stop an R script when running JGR on a Linux/SuSE system

2009-08-01 Thread Liviu Andronic
Hello, On 7/31/09, mau...@alice.it mau...@alice.it wrote: When I need to stop a running R script on Windows or Mac I just use the esc key which kills the current script and returns the control to R interpreter. But when I run R from JGR the esc is useless as well as the other available

Re: [R] SVG output on Windows OS

2009-08-01 Thread Michael Roessler
Thank you, David. Cairo is installed and loaded. cairoDevice is installed and loaded. RGtk2 is installed and loaded (which installed GTK+) yet I still get false for cairo: capabilities() jpeg png tifftcltk X11 aqua http/ftp sockets TRUE TRUE TRUE TRUE

[R] Cox ridge regression

2009-08-01 Thread Ljubomir Buturovic
Hello, I have questions regarding penalized Cox regression using survival package (functions coxph() and ridge()). I am using R 2.8.0 on Ubuntu Linux and survival package version 2.35-4. Question 1. Consider the following example from help(ridge): fit1 - coxph(Surv(futime, fustat) ~ rx +

[R] odfWeave : sudden and unexplained error

2009-08-01 Thread Emmanuel Charpentier
Dear list, dear Max, I a currently working on a report. I'm writing it with OpenOffice.org and odfWeave. I'm working increentally : I write a bit, test (interactively) some ideas, cutting-and-pasting code to the Ooo report when satisfied with it. I the process, I tend to recompile the .odt source

Re: [R] R book for economists

2009-08-01 Thread Alain Zuur
Thiemo Fetzer wrote: Dear Group, I am an economics student starting with PhD work in London. As preparation I would like to get to know R a little bit better. For Stata there are tons of books, however, can you recommend a book for R? I have some substantiated econometrics

Re: [R] Getting file name from pdf device?

2009-08-01 Thread Tom Short
On Fri, Jul 31, 2009 at 8:49 AM, Rainer M Krugr.m.k...@gmail.com wrote: My question: how can I get the filename of the pdf from the device before it is closed? I've also looked for this and couldn't find a way. I had a similar use, where I wanted to get an R transcript with embedded plots in

Re: [R] Compare lm() to glm(family=poisson)

2009-08-01 Thread Alain Zuur
Mark Na wrote: Dear R-helpers, I would like to compare the fit of two models, one of which I fit using lm() and the other using glm(family=poisson). The latter doesn't provide r-squared, so I wonder how to go about comparing these models (they have the same formula). Thanks very

Re: [R] A hiccup when using anova on gam() fits.

2009-08-01 Thread Rolf Turner
Thank you. That clarified a great many things. cheers, Rolf ## Attention:\ This e-mail message is privileged and confid...{{dropped:9}} __

Re: [R] Question about rpart decision trees (being used to predict customer churn)

2009-08-01 Thread Graham Williams
2009/7/27 Robert Smith robertpsmith2...@gmail.com Hi, I am using rpart decision trees to analyze customer churn. I am finding that the decision trees created are not effective because they are not able to recognize factors that influence churn. I have created an example situation below.

Re: [R] odfWeave : sudden and unexplained error

2009-08-01 Thread Max Kuhn
Sending me a reproducible example and the results of sessionInfo() would help. Max On Sat, Aug 1, 2009 at 5:13 PM, Emmanuel Charpentiercharp...@bacbuc.dyndns.org wrote: Dear list, dear Max, I a currently working on a report. I'm writing it with OpenOffice.org and odfWeave. I'm working

[R] R Package That Contains International Geomagnetic Reference Field (IGRF)

2009-08-01 Thread Jason Rupert
By any chance is anyone aware of an R package that contains a representation of the International Geomagnetic Reference Field (IGRF)? http://www.ngdc.noaa.gov/IAGA/vmod/igrf.html I've tracked down some Fortran and C code for the IGRF-10, and possibly IGRF-11, and was hoping to avoid an

[R] vglm{VGAM} output to Latex ?

2009-08-01 Thread Ugur Ozdemir
Hi all, I am trying to put the summary output of vglm{VGAM} into a Latex table using mtable(Memisc}. I think I solved the problem regarding to the fact that vglm produces a vglm object which is not accepted by mtable by default defining a getSummary.vglm function. However summary.vglm adds

Re: [R] SVG output on Windows OS

2009-08-01 Thread David Winsemius
It says cairo is not available. (Once you read this in a proper monospaced font, anyway.) On Aug 1, 2009, at 4:27 PM, Michael Roessler wrote: Thank you, David. Cairo is installed and loaded. cairoDevice is installed and loaded. RGtk2 is installed and loaded (which installed GTK+) yet I

Re: [R] Add columns in a dataframe and fill them from another table according to a criteria

2009-08-01 Thread David Winsemius
Apologies to list: Should have replied to all. -- DW Begin forwarded message: From: David Winsemius dwinsem...@comcast.net Date: August 1, 2009 3:02:58 PM EDT To: Meenu Sahi meenus...@gmail.com Subject: Re: [R] Add columns in a dataframe and fill them from another table according to a

Re: [R] about the summary(cph.object)

2009-08-01 Thread zhu yao
Thx for your reply. In this example, age was transformed with rcs. So the output was different between f and summary(f). If I need to publicate the results, how do I explation the hazard ratio of age? 2009/8/1 David Winsemius dwinsem...@comcast.net On Jul 31, 2009, at 11:24 PM, zhu yao wrote:

Re: [R] about the summary(cph.object)

2009-08-01 Thread Frank E Harrell Jr
zhu yao wrote: Thx for your reply. In this example, age was transformed with rcs. So the output was different between f and summary(f). If I need to publicate the results, how do I explation the hazard ratio of age? David explained this. Nonlinearity in age does not complicate the

[R] What does .[foo] really mean?

2009-08-01 Thread Simon Tian
Hi R users, I really want to know what exactly .[foo] means. Thanks in advance. -Simon [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide