[R] testing column data against criteria, point by point

2009-03-05 Thread Kara Przeczek
I am fairly new to R and I would like to do the following, but do not know where to start. Any help or direction would be appreciated. I have a time series of snow depth measurements. I would like to determine the depth of snowfall for each snowfall event. There is noise in the data so I only

[R] R on netbooks et al?

2009-03-05 Thread herrdittmann
Dear useRs, With the rise of netbooks and 'lifestyle laptops I am tempted to get one of these to mainly run R on it. Processor power and hard disk space seem to be ok. What I wonder is the handling and feel with respect to R. Has anyone here installed or is running R on one of these, and if

Re: [R] modifying a built in function from the stats package (fixing arima)

2009-03-05 Thread Marc Vinyes
If you ***look at the code*** for arima you will see that ``%+%'' is defined in terms of a call to ``.Call()'' which calls ``R_TSconv''. So apparently R_TSconv is a C or Fortran function or subroutine in a ``shared object library'' or dll upon which arima depends. Hence to do anything with it

Re: [R] Bug in by() with dates as levels?

2009-03-05 Thread Dieter Menne
hadley wickham h.wickham at gmail.com writes: You might also want to take a look at the plyr package: install.packages(plyr) library(plyr) ddply(x, .(A, D), function(df) sum(df$Z)) dlply(x, .(A, D), function(df) sum(df$Z)) I recently for the first time used the plyr package in an

Re: [R] modifying a built in function from the stats package (fixing arima)

2009-03-05 Thread Gustaf Rydevik
On Thu, Mar 5, 2009 at 10:00 AM, Marc Vinyes mvin...@aleasoft.com wrote: If you ***look at the code*** for arima you will see that ``%+%'' is defined in terms of a call to ``.Call()'' which calls ``R_TSconv''.  So apparently R_TSconv is a C or Fortran function or subroutine in a ``shared object

Re: [R] R on netbooks et al?

2009-03-05 Thread Philipp Pagel
On Thu, Mar 05, 2009 at 08:47:25AM +, herrdittm...@yahoo.co.uk wrote: With the rise of netbooks and 'lifestyle laptops I am tempted to get one of these to mainly run R on it. Processor power and hard disk space seem to be ok. What I wonder is the handling and feel with respect to R. Has

[R] is there any option like cex.axis in ggplot2?

2009-03-05 Thread Tom Cohen
Dear list,   I made boxplots using ggplot and want to control for x- and yaxis. Using plot I can do it by setting cex.axis equally to any size but can't figure out how to do it with ggplot.     ggplot(dat, aes(x = factor(time), y = volume)) +

Re: [R] modifying a built in function from the stats package (fixing arima)

2009-03-05 Thread Marc Vinyes
Just a quick note on your original question: if you use edit(arima), you have to remember that it returns the modified function, which then must be stored. I.e, use arima-edit(arima) instead of just edit(arima) ,and changes should be stored. THIS IS IT. IMHO, this should be written in BOLD

[R] the r package for svdpack?

2009-03-05 Thread Guozhu.Wen
hi all, I was finding a r-package for the svd decomposition of sparse matrix. After no package was found, I get a good fortran/c package named svdpack/svdpackc http://www.netlib.org/svdpack/. I was wondering if there are any r-package for sparse matrix svd, or any packages implement the

Re: [R] text at the upper left corner outside of the plot region

2009-03-05 Thread Jim Lemon
batho...@googlemail.com wrote: Hi, is there a way to place text at the upper left corner (or another corner) of the plot? I want to place it really at the upper left corner of the whole plot (the file I get), not at the upper left corner of the plot-region. I tried text() and mtext(),

Re: [R] R on netbooks et al?

2009-03-05 Thread Jim Lemon
herrdittm...@yahoo.co.uk wrote: With the rise of netbooks and 'lifestyle laptops I am tempted to get one of these to mainly run R on it. Processor power and hard disk space seem to be ok. What I wonder is the handling and feel with respect to R. Has anyone here installed or is running R

[R] Problem using RMySQL and fCalendar

2009-03-05 Thread Elizabeth Nichols
Hello: I am trying to use fCalendar for date arithmetic and the RMySQL package for accessing a MySQL database. The fCalendar math operations seem to work fine UNTIL I load the RMySQL package. Here is a demonstration: e...@fibonacci:~/Desktop/amCharts/rsa-metrics$ R R version 2.7.1

Re: [R] is there any option like cex.axis in ggplot2?

2009-03-05 Thread ONKELINX, Thierry
Dear Tom, You can control the size of the axis title in ggplot2. It is described in the ggplot2 book. Have a look at Chapter 8: Polishing your plots for publication. You can find the book on the ggplot2 website. I tend to create my own theme for some specific type of plots. Below you can find

[R] including tabular information with a plot in R Graphics

2009-03-05 Thread R User R User
Hi all, I have a presentation problem that I cannot find a solution to in the documetnation. I have a nice barplot. Below this I would also like a table with some information relating to the plot. My idea was to have the plot and table on the same graphics window so I can output them as an image

Re: [R] Problem using RMySQL and fCalendar

2009-03-05 Thread Yohan Chalabi
EN == Elizabeth Nichols betsy.nich...@plexlogic.com on Thu, 05 Mar 2009 05:45:40 -0500 EN Hello: EN I am trying to use fCalendar for date arithmetic and the EN RMySQL package EN for accessing a MySQL database. The fCalendar math operations EN seem to EN work fine UNTIL I load

Re: [R] text at the upper left corner outside of the plot region

2009-03-05 Thread Eik Vettorazzi
is this something that helps? plot(1,2) mtext(test low right,side=1,outer=T,adj=1,line=-1) mtext(test low left,side=1,outer=T,adj=0,line=-1) mtext(test upper right,side=3,outer=T,adj=1,line=-1) mtext(test upper left,side=3,outer=T,adj=0,line=-1) hth batho...@googlemail.com schrieb: Hi, is

[R] Error in var(x, na.rm = na.rm) : no complete element pairs

2009-03-05 Thread Carlos Morales
Hello, I still have the same error which I have written in the Subject field, I leave here the code and I hope you can help me with this: filter.clones-function(zz.info,crom.info) { clones.info-zz.info cat(Removing clones which has a flag minor than 0\n) ord -

Re: [R] including tabular information with a plot in R Graphics

2009-03-05 Thread Eik Vettorazzi
Hi Richie, have a look at textplot() from the gplots-package. hope, it helps! R User R User schrieb: Hi all, I have a presentation problem that I cannot find a solution to in the documetnation. I have a nice barplot. Below this I would also like a table with some information relating to the

[R] a few scatter plots for a specific correlation value

2009-03-05 Thread June Kim
Hello, Is there a simple way to draw a few random sample scatter plots from a given specific correlation coefficient(say, 0.18)? __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

[R] Fast Fourier Transform w.r.t. CreditRisk+

2009-03-05 Thread Maithili Shiva
Dear R Helpers, Is there any literaure available (including R code) on Fast Fourier Transform being used in CreditRisk+? I need to learn how to apply the Fast Fourier Transform. I agree I am too vaue in my question and sincerely apologize for the same, but I am not able to understand as to

[R] R on netbooks et al?

2009-03-05 Thread Millo Giovanni
Dear Bernd, I fully subscribe to Jim and Philipp's posts, plus a note on operating systems, case you're a Windows user. I've got an eeePC 900, standard Xandros Linux version, happily running R. With LaTeX-Beamer installed, weighing less than 1 Kg and with WiFi this makes for an excellent

Re: [R] problems with exporting a chart

2009-03-05 Thread Uwe Ligges
Elena Wilson wrote: Dear Uwe, Thank you very much for your email. I think I have worked out that the problem was related to the coordinates of the legend that are manually specified in the leg_loc command. However, I'm not exactly sure what was wrong with exporting the picture of the plot...

Re: [R] How to dump plots as bas64 strings?

2009-03-05 Thread Gabor Grothendieck
On Wed, Mar 4, 2009 at 9:17 AM, Patrick Meyer pater...@gmail.com wrote: Hello My question might sound awkward, but I am looking for a way to somehow convert a plot in R into a base64 string. Here's an idea, but it is not at all satisfying. 1. write the plot to the harddisk:

Re: [R] Dropping rows conditionally

2009-03-05 Thread Jason Rupert
Have you looked at subset? For example, subset(mdat, !(mdat$C.1== 11)) You will have to add your other cases and there may be a better way to programmatically get it done, but maybe this will help you get started. --- On Thu, 3/5/09, Lazarus Mramba lmra...@kilifi.kemri-wellcome.org wrote:

Re: [R] a few scatter plots for a specific correlation value

2009-03-05 Thread Chuck Cleland
On 3/5/2009 6:46 AM, June Kim wrote: Hello, Is there a simple way to draw a few random sample scatter plots from a given specific correlation coefficient(say, 0.18)? scatter - function(n=100, r=.18){ require(MASS) mymat - mvrnorm(n, mu=c(0,0), Sigma=matrix(c(1,r,r,1), ncol=2),

Re: [R] Problem using RMySQL and fCalendar

2009-03-05 Thread Elizabeth Nichols
Yohan: First, thanks so much for the virtually instantaneous reponse. I really appreciate it. It seems I now have a different problem. I did an update.packages() and that resulted in getting timeDate package installed. Here is what happens now. Note that as soon as I load RMySQL, I can't

Re: [R] How to dump plots as bas64 strings?

2009-03-05 Thread Patrick Meyer
Here's the solution I'm using now, but it is not very clean: png(out.png) plot(c(1,2,3)) dev.off() system(base64 -w0 out.png out.base64) b64txt - readLines(file(out.base64,rt)) It would be nice to have an internal solution, even if this exactly does what I want. Patrick Gabor Grothendieck

[R] R editor that will work with Rcmdr

2009-03-05 Thread John Sorkin
R 2.8.1 Windows XP Fedora Linux. I would like a suggestion for an editor that will help format my R code that can be used with Rcmdr. Is there anything I need to know about running or installing an editor when using Rcmdr? I run R on both Windows and Linux (Fedora). Thank you, John John

Re: [R] Dropping rows conditionally

2009-03-05 Thread David Winsemius
There are functions for this purpose: ?na.omit # dispays help page for na.fail, na.omit, na.exclude, na.pass -- David Winsemius On Mar 5, 2009, at 1:18 AM, Lazarus Mramba wrote: Dear R-help team, I am getting addicted to using R but keep on getting many challenges on the way

[R] Doubt Linear Regression

2009-03-05 Thread Sueli Rodrigues
Hello. I have a file with 480 lines but each 6 lines corresponding just one sample. How can can work out the linear regression to each 6 lines? I use the model: model=lm(y~x) Sueli Rodrigues Agronomy Eng. - UNESP Master Degree - USP/ESALQ PPG-Soils and Plants Nutrition Phones(19)93442981

[R] File checking

2009-03-05 Thread ling ling
Hello, How can I check if file is empty in R, if it is, then jump out and read next file; if it isn't, then read through? Thanks a lot for any help. Tammy _ More than messages–check out the rest of the Windows Live™.

[R] Odp: testing column data against criteria, point by point

2009-03-05 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 05.03.2009 09:46:17: I am fairly new to R and I would like to do the following, but do not know where to start. Any help or direction would be appreciated. I have a time series of snow depth measurements. I would like to determine the depth of

Re: [R] File checking

2009-03-05 Thread Gabor Grothendieck
Try this: file.info(empty.txt)$size == 0 On Thu, Mar 5, 2009 at 7:43 AM, ling ling metal_lical...@live.com wrote: Hello, How can I check if file is empty in R, if it is, then jump out and read next file; if it isn't, then read through? Thanks a lot for any help. Tammy

[R] subset

2009-03-05 Thread yannick misteli
Hi, I have a vector x with certain ID numbers in it and want to create a subset from my dataset Y with this vector i.e extract only the data with the given IDs from vector x. example: x [1] 10066924 10207314 10257322 10334594 10348247 and now I want to create subset of dataset assignee

Re: [R] File checking

2009-03-05 Thread jim holtman
?file.info On Thu, Mar 5, 2009 at 7:43 AM, ling ling metal_lical...@live.com wrote: Hello, How can I check if file is empty in R, if it is, then jump out and read next file; if it isn't, then read through? Thanks a lot for any help. Tammy

Re: [R] Doubt Linear Regression

2009-03-05 Thread Chuck Cleland
On 3/5/2009 7:53 AM, Sueli Rodrigues wrote: Hello. I have a file with 480 lines but each 6 lines corresponding just one sample. How can can work out the linear regression to each 6 lines? I use the model: model=lm(y~x) mydf - data.frame(X = rnorm(480), Y = rnorm(480)) mydf$SAMPLE - rep(1:80,

Re: [R] R editor that will work with Rcmdr

2009-03-05 Thread John Fox
Dear John, I'm not entirely sure what you have in mind. Any editor or IDE that communicates with the R process and is compatible with the tcltk package will work in parallel with the Rcmdr. That is, when you submit R code from the editor, it will go directly to R and not to the Rcmdr script

Re: [R] testing column data against criteria, point by point

2009-03-05 Thread David Winsemius
Look at these functions. They should give you the building blocks you need: ?diff # returns a vector of length n-1 #it would be a logical vector if wrapped in the appropriate functions #needs to be padded to line up with dataframes ?rle# returns a list with the lengths and

Re: [R] R editor that will work with Rcmdr

2009-03-05 Thread Peter Dalgaard
John Fox wrote: Dear John, I'm not entirely sure what you have in mind. Any editor or IDE that communicates with the R process and is compatible with the tcltk package will work in parallel with the Rcmdr. That is, when you submit R code from the editor, it will go directly to R and not to

[R] predict.fda - NAs are not allowed in subscripted assignments

2009-03-05 Thread monica.ca...@libero.it
Dear R users, I'm trying to perform flexible discriminant analysis (fda) with method bruto. I applied the fda function on my training data: bruto.fda - fda (fda.formula,data=train.data) where fda.formula is: PRES ~ VA_D123 + VA_D124 + VA_D127 + VA_DARU + VA_DCAN + VA_DFON + VA_DLAP +

Re: [R] subset

2009-03-05 Thread K. Elo
Hi Yannick, yannick misteli wrote: I have a vector x with certain ID numbers in it and want to create a subset from my dataset Y with this vector i.e extract only the data with the given IDs from vector x. example: x [1] 10066924 10207314 10257322 10334594 10348247 and now I want to

[R] Odp: subset

2009-03-05 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 05.03.2009 14:00:25: Hi, I have a vector x with certain ID numbers in it and want to create a subset from my dataset Y with this vector i.e extract only the data with the given IDs from vector x. example: x [1] 10066924 10207314 10257322

Re: [R] portable R editor

2009-03-05 Thread jcfaria
Hi Werner, Could you to post here details about the Tinn-R truly portable with JauntePE? I think it will be also useful for all Tinn-R users, like me. ;-) Many thanks, JCFaria Werner W. wrote: Many, many thanks for all the answers! Notepad++ looks very promising although it does not

Re: [R] including tabular information with a plot in R Graphics

2009-03-05 Thread Frank E Harrell Jr
R User R User wrote: Hi all, I have a presentation problem that I cannot find a solution to in the documetnation. I have a nice barplot. Below this I would also like a table with some information relating to the plot. My idea was to have the plot and table on the same graphics window so I can

Re: [R] R on netbooks et al?

2009-03-05 Thread Erik Iverson
I've installed Ubuntu, Emacs, and R on my Samsung NC10 with 2 GB RAM. I think the keyboard is very usable on the NC10, and it has about 5-7 hours of battery life, which is also nice. R runs just fine on it. I'd consider paying extra for the Samsung just for the keyboard.

[R] identify() and postscript output

2009-03-05 Thread Michael Friendly
In the following, I'm fitting a logistic regression model, and using car:::influencePlot. When I run the latter with output to the screen, it calls identify() that lets me label observations with large CookD. However, if I use postscript() to get .eps output, identify() seems not to be

Re: [R] portable R editor

2009-03-05 Thread Werner W.
JauntePE is really easy to use. It does not take any particular skill. Just launch the main application, click on the Lauch JPE Quickie Button and it will guide you through the process. I left everything with the default settings. In brief, one starts the Tinn-R installer once from within JPE

Re: [R] Odp: nice way to find or not a value (problem with numeric(0))

2009-03-05 Thread Ptit_Bleu
Hello Petr, In fact spec is data.frame with a column called code (containing numerical values) and some other columns called data1, data2, ... containing data for each equipment (that is for each code). But I don't have the data for all my devices. It means that some 'code' are not in

[R] RES: R on netbooks et al?

2009-03-05 Thread Leandro Marino
I use it on an ASUS EEE 701 PC! It works with some limitation, because this model have only 512mb of RAM. But it is working fine. The OS is Windows XP. I think that the better netbooks is one from HP, this netbook have an normal keyboard. Atenciosamente, Leandro Lins Marino Centro de Avaliação

Re: [R] dividing ts objects of different frequencies

2009-03-05 Thread Jeffrey J. Hallman
Stephen J. Barr stephenjb...@gmail.com writes: I have two time series (ts) objects, 1 is yearly (population) and the other is quarterly (bankruptcy statistics). I would like to produce a quarterly time series object that consists of bankruptcy/population. Is there a pre-built function to

[R] dummy variable encoding

2009-03-05 Thread news
Hi, can anyone tell me why an encoding of 1/2 for a dummy variable for two groups (e.g. gender) seems to be preferred over 0/1? It's been bugging me for a while, 0/1 seems more natural, but I have been told (without explanation) that 1/2 is better. Why? -- aleblanc

Re: [R] identify() and postscript output

2009-03-05 Thread David Winsemius
From the help page: Details identify is a generic function, and only the default method is described here. identify is only supported on screen devices such as X11, windows and quartz. On other devices the call will do nothing. Why not collect the specifics of the identified points and

[R] programing for partial maximum likelihood for cox models with two covariate

2009-03-05 Thread Kourosh Ks
dears, I like two write a program with R to estimate the coefficients of covariate,I like two know the original program for this programing for partial maximum likelihood for cox models with two co variate. I did it with coxph command, thanks [[alternative HTML version

[R] character string as object name

2009-03-05 Thread Fuchs Ira
Can someone please tell me why the following (last line) doesn't work (as I expect it to :-) library(quantmod) a = getSymbols(MSFT,from=2009-3-01) a MSFT eval(as.name(a)) MSFT$MSFT.Adjusted b=paste(a,'$MSFT.Adjusted',sep='') b eval(as.name(b)) Why does this last line not work the way the

Re: [R] Fast Fourier Transform w.r.t. CreditRisk+

2009-03-05 Thread stephen sefick
schmway and morgan time series analysis with R examples is a good intro to fourier analysis. Also there are probably references in the help for ?fft Stephen On Thu, Mar 5, 2009 at 5:48 AM, Maithili Shiva maithili_sh...@yahoo.com wrote: Dear R Helpers, Is there any literaure available

Re: [R] character string as object name

2009-03-05 Thread Prof Brian Ripley
b is character string: as.name(b) `MSFT$MSFT.Adjusted` Note the backticks: that is a valid (if non-syntatatic) name, but you don't have an object of that name. On Thu, 5 Mar 2009, Fuchs Ira wrote: Can someone please tell me why the following (last line) doesn't work (as I expect it to

[R] Time Series - ARIMA differencing problem

2009-03-05 Thread thefurryblur
Hi, I have been using this website ( http://www.stat.pitt.edu/stoffer/tsa2/Rissues.htm http://www.stat.pitt.edu/stoffer/tsa2/Rissues.htm ) to help me to fit ARIMA models to my data. At the moment I have two possible methods to use. Method 1 If I use arima(ts.data, order=c(1,2,0),

Re: [R] Fast Fourier Transform w.r.t. CreditRisk+

2009-03-05 Thread Carlos J. Gil Bellosta
Hello, You have a link on the subject here: http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1122844 The author has extra literature and code on the subject. Also, there was a thread in R-SIG-Finance list on the subject a few months ago. Best regards, Carlos J. Gil Bellosta

Re: [R] FW: flow control

2009-03-05 Thread Peter Dalgaard
William Dunlap wrote: The help page for ?for says that: The index seq in a for loop is evaluated at the start of the loop; changing it subsequently does not affect the loop. The variable var has the same type as seq, and is read-only: assigning to it does not alter seq. The

[R] Does R have function or method to finish my task?

2009-03-05 Thread zhijie zhang
Dear all, Does R have function or method to finish the following task. Say i have a dataset. The response variable is Y, and the indepedent variables are X1, X2, X3, and YEAR. See an example. Y X1X2X3 X4YEAR 13.4 2.8 3.5

Re: [R] character string as object name

2009-03-05 Thread Patrick Burns
Does the first item on page 52 of 'The R Inferno' explain it for you? If not, can you give some hints about how to improve the explanation? Patrick Burns patr...@burns-stat.com +44 (0)20 8525 0696 http://www.burns-stat.com (home of The R Inferno and A Guide for the Unwilling S User) Fuchs Ira

Re: [R] R on netbooks et al?

2009-03-05 Thread Michael A. Miller
Jim == Jim Lemon j...@bitwrit.com.au writes: I've got R on my little EeePC as well. Great for most jobs and I highly recommend a DC/DC convertor for plugging into your car's cigarette lighter to get around the crap battery problem. I run R on my Eee PC as well - no problems

Re: [R] dummy variable encoding

2009-03-05 Thread Richard . Cotton
can anyone tell me why an encoding of 1/2 for a dummy variable for two groups (e.g. gender) seems to be preferred over 0/1? It's been bugging me for a while, 0/1 seems more natural, but I have been told (without explanation) that 1/2 is better. Why? The best encoding depends upon

[R] ANOVA

2009-03-05 Thread kayj
Hi All, I have about one hundred patients and all the patients had their glucose measured on three different days. The days are all the same for all he patients. So I have three measurement for each patient . I want to know whether the day when the glucose was measured has an effect on the

[R] R 2.9.0 is scheduled for April 17

2009-03-05 Thread Peter Dalgaard
This is to announce that we plan to release R version 2.8.0 on Friday, April 17, 2009. Release procedures start Tuesday March 17. The detailed schedule can be found on http://developer.r-project.org The source tarballs will be made available daily (barring build troubles) and the tarballs can be

[R] Time Series - ARIMA differencing problem

2009-03-05 Thread thefurryblur
Hi, I have been using this website ( http://www.stat.pitt.edu/stoffer/tsa2/Rissues.htm http://www.stat.pitt.edu/stoffer/tsa2/Rissues.htm ) to help me to fit ARIMA models to my data. At the moment I have two possible methods to use. Method 1 If I use arima(ts.data, order=c(1,2,0),

[R] missings

2009-03-05 Thread kayj
I have a file where the missings are coded as NA or blank. how can I tell R to read the data set and to consider the missings NA or a blank. I tried the following data-read.table(data.txt, sep='\t', header=T, na.strings=c(NA,)) is it correct? I am new to R and I am not sure if R is

Re: [R] R editor that will work with Rcmdr

2009-03-05 Thread John Sorkin
Peter, I see that you do not think Rcmdr should be used to as a program editor for R code. I understand that modifying Rmcdr to make it an editor would be an enormous undertaking, nevertheless, having a program editor that works with Rcmdr would be a wonderful addition to what is already an

[R] Sending an alert / email when R finished?

2009-03-05 Thread nhawrylyshyn
Hi, Not sure if this is the best section to post it in. I'm doing lengthy runs on a 30GB data set - I would like to know if it is possible through any means for R to send an email / text message or anything when it has finished running a source file. Any suggestions would be appreciated. Nick.

[R] Boostrapping

2009-03-05 Thread march
Hi Everybody, I am trying to use the no parametric boostrapping methos to validate a logistic regression model. My idea is to randomly select the observations of a dataset and estimating the coefficients of the model for each random selection. Do you have any idea about that? Please, Let me

Re: [R] R editor that will work with Rcmdr

2009-03-05 Thread John Fox
Dear Peter, I've resisted trying to make the script window a full-fledged editor but it's been moving in that direction (right-click context menu, line wrapping, etc). I don't think that the Ctext widget is currently provided via the tcltk package. I still think that people who want a real

[R] hatvalues?

2009-03-05 Thread rkevinburton
I am struiggling a bit with this function 'hatvalues'. I would like a little more undrestanding than taking the black-box and using the values. I looked at the Fortran source and it is quite opaque to me. So I am asking for some help in understanding the theory. First, I take the simplest case

Re: [R] programing for partial maximum likelihood for cox models with two covariate

2009-03-05 Thread David Winsemius
On Mar 5, 2009, at 10:08 AM, Kourosh Ks wrote: dears, I like two write a program with R to estimate the coefficients of covariate,I like two know the original program for this programing for partial maximum likelihood for cox models with two co variate. I did it with coxph command,

Re: [R] character string as object name

2009-03-05 Thread Fuchs Ira
I thought that's what I had: b [1] MSFT$MSFT.Adjusted eval(as.name(b)) Error in eval(expr, envir, enclos) : object MSFT$MSFT.Adjusted not found However, Patrick's suggestion of eliminating the '$' gave me what I was looking for: b=paste(a,'.Adjusted',sep='') eval(as.name(a))[,b]

Re: [R] identify() and postscript output

2009-03-05 Thread Michael Friendly
Prof Brian Ripley wrote: If instead, I use dev.copy2eps() after getting output to the screen, the point labels do not appear in the resulting .eps graph. Why? Is there a workaround? I don't think that is true: plot(1:10) identify(1:10) ## Click near points 6 and 7 dev.copy2eps(test.eps)

Re: [R] character string as object name

2009-03-05 Thread Wacek Kusnierczyk
Fuchs Ira wrote: Can someone please tell me why the following (last line) doesn't work (as I expect it to :-) library(quantmod) a = getSymbols(MSFT,from=2009-3-01) a MSFT eval(as.name(a)) MSFT$MSFT.Adjusted b=paste(a,'$MSFT.Adjusted',sep='') b eval(as.name(b)) Why does this last line

[R] Overriding contributed package functions

2009-03-05 Thread Richard Saba
The tsdiag function in the TSA package overrides the tsdiag function in the stats package. There are a few annoying bugs in the TSA's version of the function so I would like to use the stats function but still have access to other TSA functions. I have tried using stats::tsdiag( ) but as long

Re: [R] Sending an alert / email when R finished?

2009-03-05 Thread Charles C. Berry
On Thu, 5 Mar 2009, nhawrylyshyn wrote: Hi, Not sure if this is the best section to post it in. I'm doing lengthy runs on a 30GB data set - I would like to know if it is possible through any means for R to send an email / text message or anything when it has finished running a source file.

[R] Date conversion

2009-03-05 Thread Pele
Hi R users, I have a factor variable called date as shown below: Can anyone share the best / most efficient way to extract year and week (e.g. year = 2006, week = 52 for first record, etc..)? My data set has 1 million records. DATE 11DEC2006 11SEP2006 01APR2007 02DEC2007 Thanks in

Re: [R] text at the upper left corner outside of the plot region

2009-03-05 Thread Greg Snow
In addition to the other responses that you have received, you can use the grconvertX and grconvertY functions to convert between the different coordinate systems, the upper left corner will be 0,1 in ndc (whole device/page), nfc (figure region), npc (plot region), or nic (inside the outer

[R] Import the files.

2009-03-05 Thread ling ling
Dear all, I am a newcomer to R programming, I met the problem: I have a lot of .txt files in my directory. Firstly, I check whether the file satisfies the conditions: 1.empty 2.the Rep column of the file has no useractivity_idle or useractivity_act 3.even The rep has both of them, numbers of

Re: [R] hatvalues?

2009-03-05 Thread John Fox
Dear Kevin, If you do the same regression as in the text then you'll get the same hat-values; the regression is the one on the top of p. 244: mod - lm(repwt ~ weight*sex, data=Davis) max(hatvalues(mod)) [1] 0.7141856 As to making sense of the computations: X - model.matrix(mod) head(X)

[R] RV: help

2009-03-05 Thread Jani Lobo
Dear Sirs, I want to estimate the survival mean of a few specific teams. I'm trying to calculate it through a Kaplan Meier estimator. For doing so, I load the survival package and run the following instructions: options(survfit.print.mean=TRUE) allows showing the mean

Re: [R] including tabular information with a plot in R Graphics

2009-03-05 Thread Greg Snow
Also see the addtable2plot in the plotrix package. -- 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 R User R

Re: [R] missings

2009-03-05 Thread jim holtman
This seems to work fine without the na.strings. Can you include the data that you were reading: x - read.table(textConnection(1,2,3,4 + 5,,6,NA + ,7,NA,8 + ,,NA,9), sep=',') closeAllConnections() x V1 V2 V3 V4 1 1 2 3 4 2 5 NA 6 NA 3 NA 7 NA 8 4 NA NA NA 9 On Thu, Mar 5, 2009 at

Re: [R] a few scatter plots for a specific correlation value

2009-03-05 Thread Greg Snow
See the run.cor.examp function in the TeachingDemos package (in addition to the mvrnorm function in MASS). Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 -Original Message- From:

Re: [R] Date conversion

2009-03-05 Thread Uwe Ligges
Pele wrote: Hi R users, I have a factor variable called date as shown below: Can anyone share the best / most efficient way to extract year and week (e.g. year = 2006, week = 52 for first record, etc..)? My data set has 1 million records. DATE 11DEC2006 11SEP2006 01APR2007

Re: [R] Does R have function or method to finish my task?

2009-03-05 Thread Greg Snow
I think that the dynlm package was designed for just such a problem. I also would not be surprised if there are tools in the zoo package to do this. You should probably check out the time series task view on CRAN as well. Hope this helps, -- Gregory (Greg) L. Snow Ph.D. Statistical Data

Re: [R] Date conversion

2009-03-05 Thread Sundar Dorai-Raj
Hi, There are possibly several ways to do this. My approach would be: dates - strptime(as.character(DATE), %d%b%Y) year - dates$year + 1900 week - floor(dates$yday/365 * 52) HTH, --sundar On Thu, Mar 5, 2009 at 8:58 AM, Pele drdi...@yahoo.com wrote: Hi R users, I have a factor variable

Re: [R] Overriding contributed package functions

2009-03-05 Thread Greg Snow
Have you tried using the pos argument in the library function to load the TSA package after the stats package? -- 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

Re: [R] Inference for R Spam

2009-03-05 Thread Michael A. Miller
Rolf == Rolf Turner r.tur...@auckland.ac.nz writes: My impression --- and I could be wrong --- is that physicists understanding of randomness is very narrow and constrained. They tend to think along the lines of chaotic dynamical systems (although perhaps not consciously;

Re: [R] Sending an alert / email when R finished?

2009-03-05 Thread Gesmann, Markus
You could send a message to Twitter, see: http://finzi.psych.upenn.edu/R/Rhelp08/2009-February/187822.html Regards Markus -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Charles C. Berry Sent: 05 March 2009 17:03 To: nhawrylyshyn

Re: [R] Date conversion

2009-03-05 Thread Pele
Hi Uwe, You are correct - that was a type O (52) and thanks for you your suggestion that works.. Pele wrote: Hi R users, I have a factor variable called date as shown below: Can anyone share the best / most efficient way to extract year and week (e.g. year = 2006, week = 52 for

Re: [R] R on netbooks et al?

2009-03-05 Thread chaogai
I'm having similar experiences on my Acer Aspire One. Everything will work good. Only thing that takes a lot of time is compiling R if you are in the habit of doing so. herrdittm...@yahoo.co.uk wrote: Dear useRs, With the rise of netbooks and 'lifestyle laptops I am tempted to get one of

Re: [R] Error in var(x, na.rm = na.rm) : no complete element pairs

2009-03-05 Thread ml-r-help
Carlos Morales wrote: Hello, I still have the same error which I have written in the Subject field, I leave here the code and I hope you can help me with this: [removed] the lengthy code example does not make it easier to help you, in particular without the data you used. All the

Re: [R] How to dump plots as bas64 strings?

2009-03-05 Thread Duncan Temple Lang
Patrick Meyer wrote: Here's the solution I'm using now, but it is not very clean: png(out.png) plot(c(1,2,3)) dev.off() system(base64 -w0 out.png out.base64) b64txt - readLines(file(out.base64,rt)) It would be nice to have an internal solution, even if this exactly does what I want. I'm

[R] Installing the Rstem package

2009-03-05 Thread Maria I. Tchalakova
Hello, I am trying to install the Rstem package, but I have problems. I am using Windows XP and the 2.8.1 version of R. I have read the Add-on packages chapter of the R Installation and Administration manual, and also have tried several things, which worked for other people on the mailing list

[R] File checking problem

2009-03-05 Thread ling ling
Dear all, I am a newcomer to R programming, I met the problem: I have a lot of .txt files in my directory. Firstly, I check whether the file satisfies the conditions: 1.empty 2.the Rep column of the file has no useractivity_idle or useractivity_act 3.even The rep has both of them, numbers of

Re: [R] Overriding contributed package functions

2009-03-05 Thread Prof Brian Ripley
The problem is that tsdiag is a generic (the same in both packages), and package TSA sets methods for it (and methods for classes in package stats which has already registered methods). stats:::tsdiag.Arima(model1) ought to work (it does for me in your example), but please take with up

Re: [R] File checking problem

2009-03-05 Thread Barry Rowlingson
2009/3/5 ling ling metal_lical...@live.com: Dear all, I am a newcomer to R programming, I met the problem: I have a lot of .txt files in my directory. Firstly, I check whether the file satisfies the conditions: 1.empty 2.the Rep column of the file has no useractivity_idle or

  1   2   >