Re: [R] ipredknn - How may I find values?

2009-10-28 Thread David Winsemius
On Oct 27, 2009, at 8:37 PM, Grzes wrote: I'm sorry David, this is my code once again: library(klaR) library(ipred) library(mlbench) data(PimaIndiansDiabetes2) dane=na.omit(PimaIndiansDiabetes2)[,c(2,5,9)] dane[,2]=log(dane[,2]) dane[,1:2]=scale(dane[,1:2])

Re: [R] Cannot activate chm help in R 2.10

2009-10-28 Thread Ulrike Groemping
Charles, not quite in response to your question, but I think a better message in R 2.10 would be to suggest use of help_type=html (which can of course be included in Rprofile.site). While chm is no longer supported, html has been substantially improved and provides new linking facilities between

Re: [R] how do I plot a regression curve with the data?

2009-10-28 Thread Peter Ehlers
Ken Ervin wrote: I have a data set of 6 or so ordered pairs, and I've been able to graph them and have decided to use a high-order polynomial regression. I've used the following piece of code: regression - function(x,y) { x - c(insert_numbers_here) y - c(insert_other_numbers_here)

Re: [R] re gression with multiple dependent variables?

2009-10-28 Thread Rnewb
thanks for the quick and accurate responses! cheers, Rnewb -- View this message in context: http://www.nabble.com/regression-with-multiple-dependent-variables--tp26088025p26088943.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] need help explain the routine input parameters for seROC and cROC found in the R archive

2009-10-28 Thread Dieter Menne
waverley palo wrote: I found the code in the archive. The author of this script says: The first function (seROC) calculate the standard error of ROC curve, the second function (cROC) compare ROC curves. From: Bernardo Rangel Tura ... The original post has given the definition

Re: [R] Rjava, RImageJ, and/or S4 question.

2009-10-28 Thread Romain Francois
Hello, On 10/28/2009 12:21 AM, Robert Baer wrote: I am out of my league with this question. The following code starts the java imaging program ImageJ from within R, and displays an image (assuming ImageJ is installed on your computer). It does not assume ImageJ is installed, a version of

Re: [R] Detection Times and Poisson Distribution

2009-10-28 Thread Karl Ove Hufthammer
On Tue, 27 Oct 2009 12:11:42 -0700 (PDT) Ben Bolker bol...@ufl.edu wrote: This is not quite right because we have estimated the rate from the data -- from ?ks.test ... But perhaps not a bad start. Actually, it is a very bad start. Using estimated parameters in tests like ks.test gives

[R] read.table but more tables at once

2009-10-28 Thread Sybille Wendel
Dear all, I have a lot of data files (.txt) that I want to read in all at once, if possible. the files have names in time system. for example: RA940101, RA940102, RA940103, RA940104 an so on. (meaning: RA, year:91, month: here january, day of the month.) I tried something like vektor -

Re: [R] Non-normal residuals.

2009-10-28 Thread Karl Ove Hufthammer
On Tue, 27 Oct 2009 18:06:02 -0400 Ben Bolker bol...@ufl.edu wrote: If transforming your data brings you closer to satisfying the assumptions of your analytic methods and having a sensible analysis, then that's good. If it makes things worse, that's bad. Other choices, depending on the

Re: [R] read.table but more tables at once

2009-10-28 Thread baptiste auguie
Hi, Try this, files - paste(RA94010,1:3,sep=) # or files - list.files(pattern = RA94010) list.of.data - lapply(files, read.table, header=F) # if required, collapse into a single data.frame do.call(rbind, list.of.data) HTH, baptiste 2009/10/28 Sybille Wendel wendel.sybi...@googlemail.com:

Re: [R] read.table but more tables at once

2009-10-28 Thread Barry Rowlingson
On Wed, Oct 28, 2009 at 9:38 AM, Sybille Wendel wendel.sybi...@googlemail.com wrote: Dear all, I have a lot of data files (.txt) that I want to read in all at once, if possible. the files have names in time system. for example: RA940101, RA940102, RA940103, RA940104 an so on. (meaning: RA,

[R] x11(title=' ')

2009-10-28 Thread ms.com
Dear all I was trying to put a title for my plot, but i got this result, x11(width=10,height=5,title=seedling);par(mfrow=c(1,2))Error in x11(width = 10, height = 5, title = seedling) : unused argument(s) (title = seedling) The title is not taking How can i give a title for the plot

Re: [R] tk_choose.files without multiple selection?

2009-10-28 Thread Eger, Marcus
Thanks a lot. I installed tcl8.5 and tk8.5 (version 8.5.6) of ubuntu jaunty (there were no conflicts with dependencies = hardy) and everything works. Regards Marcus -Ursprüngliche Nachricht- Von: Prof Brian Ripley [mailto:rip...@stats.ox.ac.uk] Gesendet: Dienstag, 27.

Re: [R] Non-normal residuals.

2009-10-28 Thread David Scott
Karl Ove Hufthammer wrote: On Tue, 27 Oct 2009 18:06:02 -0400 Ben Bolker bol...@ufl.edu wrote: If transforming your data brings you closer to satisfying the assumptions of your analytic methods and having a sensible analysis, then that's good. If it makes things worse, that's bad. Other

Re: [R] re gression with multiple dependent variables?

2009-10-28 Thread John Sorkin
Rnewb, Have you given any thought to multivariate linear regression (i.e. MAOVA in which there are multiple dependent variables )? This type of regression makes a number of assumptions beyond the usual regression model including multivariate normality of the outcome variables, but can be very

Re: [R] Cannot activate chm help in R 2.10

2009-10-28 Thread Duncan Murdoch
On 27/10/2009 10:18 PM, Charles Annis, P.E. wrote: R-insiders: While trying to be clever I inserted these lines in ..\Rprofile.site (which works in R2.9.2 and earlier) # to prefer Compiled HTML help options(chmhelp=TRUE) but upon re-starting R2.10.0 I learned that chmhelp = TRUE is no

[R] compilation options to get install.packages() to invoke tcl/tk

2009-10-28 Thread Geoff Russell
Hi UseRs, I've just installed 2.10.0 on Ubuntu hardy, compiling from the tar.gz bundle. install.packages() just says Error in install.packages() : no packages were specified The normal hardy 2.6.2 version pops up a tcl/tk menu for repositories. I'm assuming I missed a configure option for

[R] regression on large file

2009-10-28 Thread Georg Ehret
Dear R community, I have a fairly large file with variables in rows. Every variable (thousands) needs to be regressed on a reference variable. The file is too big to load into R (or R gets too slow having done it) and I do now read in line by line with scan (see below) and write the results to

Re: [R] x11(title=' ')

2009-10-28 Thread Prof Brian Ripley
On Wed, 28 Oct 2009, ms.com wrote: Dear all I was trying to put a title for my plot, but i got this result, x11(width=10,height=5,title=seedling);par(mfrow=c(1,2))Error in x11(width = 10, height = 5, title = seedling) : unused argument(s) (title = seedling) The title is not taking How

Re: [R] compilation options to get install.packages() to invoke tcl/tk

2009-10-28 Thread Peter Dalgaard
Geoff Russell wrote: Hi UseRs, I've just installed 2.10.0 on Ubuntu hardy, compiling from the tar.gz bundle. install.packages() just says Error in install.packages() : no packages were specified The normal hardy 2.6.2 version pops up a tcl/tk menu for repositories. I'm assuming I

Re: [R] regression on large file

2009-10-28 Thread Barry Rowlingson
On Wed, Oct 28, 2009 at 11:50 AM, Georg Ehret georgeh...@gmail.com wrote: Dear R community,   I have a fairly large file with variables in rows. Every variable (thousands) needs to be regressed on a reference variable. The file is too big to load into R (or R gets too slow having done it) and

Re: [R] Creating a sparse matrix from a file

2009-10-28 Thread Pallavi P
Hi Martin, I followed your example on my set of data. Which has non zero values in 300k positions in 22638 X 80914 sparse matrix. I am able to load data into a field and was able to do some operations (essentially t(m) %*% m). However, when I tried to display the value in the resulted matrix. I

Re: [R] compilation options to get install.packages() to invoke tcl/tk

2009-10-28 Thread Geoff Russell
On Wed, Oct 28, 2009 at 9:27 PM, Peter Dalgaard p.dalga...@biostat.ku.dk wrote: Geoff Russell wrote: Hi UseRs, I've just installed 2.10.0 on Ubuntu hardy, compiling from the tar.gz bundle. install.packages() just says Error in install.packages() : no packages were specified [snip ... ]

[R] boxplot, data frame and html

2009-10-28 Thread Silvano
Hi, I'm trying put in same page: - a data frame with 3 columns and 45 lines; - a box plot; the code is: require(hwriter) hwrite(t1000[,c(1,5,6)], 'T1000.html', bgcolor='#ffdc98', row.bgcolor='#ffdc98', br=TRUE) p = openPage('T1000.html') hwriteImage('caixa.jpg', p, br=TRUE)

[R] 'R CMD check' fails with evaluation nested too deeply: infinite recursion

2009-10-28 Thread Joerg van den Hoff
I get the error Error : evaluation nested too deeply: infinite recursion / options(expressions=)? during a 'R CMD check ...' on one of my packages. The reason seems to be that this package is mutually dependent on another one (i.e. the DESCRIPTION files of package A lists package B under

Re: [R] wilcox.exact() problem

2009-10-28 Thread David Croll
Dear Achim, let me thank you for this assurance! The sample size is too large (~4000 observations per group) to solve this problem exactly. The error message could maybe be improved, but the message is clear: This is too large to deal with. However, this is not a problem. With several

[R] how can i call R program from one java program?

2009-10-28 Thread wesley mathew
Dear All I want to call the R program from one Java program because In my project R program parameters are set by one web page developed by java. Is this possible to call R program from java? many thanks in advance -- Wesley C Mathew [[alternative HTML version deleted]]

[R] Generating sequence of dates

2009-10-28 Thread Vadlamani, Satish {FLNA}
Hello All: I have the following question # instantiate a date current = as.Date(2009/10/25) #generate a sequence of dates in the future future_dates = seq(current,by='1 week',length=53) Question: How to generate a sequence of past dates starting one week in the past relative to the current

Re: [R] how can i call R program from one java program?

2009-10-28 Thread Romain Francois
On 10/28/2009 12:47 PM, wesley mathew wrote: Dear All I want to call the R program from one Java program because In my project R program parameters are set by one web page developed by java. Is this possible to call R program from java? many thanks in advance Hi, This has many different

[R] Vector grouping challenge

2009-10-28 Thread Johannes Graumann
Dear all, Is there an efficient way to get this list testList - list(c(1),c(2,3,4),c(5,6),c(7),c(8),c(9,10,11,12),c(13)) from this vector testVector - c(12,32,NA,NA,56,NA,78,65,87,NA,NA,NA,90) ? Basically the vector should be grouped, such that non-NA and all following NAs end up in one

Re: [R] Generating sequence of dates

2009-10-28 Thread jim holtman
try this: current = as.Date(2009/10/25) start - seq(current, by='-1 week', length=2)[2] seq(start, by='1 week', length=10) [1] 2009-10-18 2009-10-25 2009-11-01 2009-11-08 2009-11-15 2009-11-22 2009-11-29 2009-12-06 2009-12-13 [10] 2009-12-20 On Wed, Oct 28, 2009 at 7:57 AM, Vadlamani,

Re: [R] boxplot, data frame and html

2009-10-28 Thread Gregoire Pau
Hello Silvano, 'hwrite' appends HTML elements in a web page. The web page has to be opened before adding elements in it. The following code should work: require(hwriter) p = openPage('T1000.html') hwrite(t1000[,c(1,5,6)], p, bgcolor='#ffdc98', row.bgcolor='#ffdc98', br=TRUE)

Re: [R] Vector grouping challenge

2009-10-28 Thread jim holtman
Is this what you want: testVector - c(12,32,NA,NA,56,NA,78,65,87,NA,NA,NA,90) # get the breaks at the NAs xb - cumsum(!is.na(testVector)) split(seq(length(testVector)), xb) $`1` [1] 1 $`2` [1] 2 3 4 $`3` [1] 5 6 $`4` [1] 7 $`5` [1] 8 $`6` [1] 9 10 11 12 $`7` [1] 13 On Wed, Oct

Re: [R] Generating sequence of dates

2009-10-28 Thread Vadlamani, Satish {FLNA}
Thanks. Please expect more newbie questions!! Satish -Original Message- From: jim holtman [mailto:jholt...@gmail.com] Sent: Wednesday, October 28, 2009 7:05 AM To: Vadlamani, Satish {FLNA} Cc: R-help@r-project.org Subject: Re: [R] Generating sequence of dates try this: current =

Re: [R] x11(title=' ')

2009-10-28 Thread Jim Lemon
On 10/28/2009 09:51 PM, Prof Brian Ripley wrote: ... Are you perchance x11() on Windows, when you should be using windows()? The posting guide asked you to tell us your OS, amongst other things I say, my dear professor, if this MS chap who has used a Microsoft email client and a

Re: [R] Vector grouping challenge

2009-10-28 Thread Johannes Graumann
Just so. I got until 'split' but was stuck on how to get the breaks ... Thank you! Joh jim holtman wrote: Is this what you want: testVector - c(12,32,NA,NA,56,NA,78,65,87,NA,NA,NA,90) # get the breaks at the NAs xb - cumsum(!is.na(testVector)) split(seq(length(testVector)), xb)

Re: [R] Vector grouping challenge

2009-10-28 Thread jim holtman
What the breaks are is that you are looking to see where the NAs start. In your case, you wanted the value at the start of the NA string to be grouped with the following NAs. The 'is.na' will return TRUE for NAs and if you invert the vector, you will have TRUE for each of the non-NA values. By

[R] cross-over designs

2009-10-28 Thread Data Analytics Corp.
Hi, I have a dataset from a client where the data is from a cross-over design. Basically, each subject in a survey was asked to rate two products, A and B. The subject sampled A first and then after an appropriate wash-out period he/she sampled B. The next subject did the same, but in a

Re: [R] WAR file installation

2009-10-28 Thread Vijaya Parthiban
I know of one called Biocep / Virtual R workbench! Info here: http://www.ebi.ac.uk/microarray-srv/frontendapp/ Best, Parthiban. 2009/10/27 Cedrick W. Johnson cedr...@cedrickjohnson.com WAR files are strictly in the J2EE realm, not something related to R. You have to install your choice of

[R] HoltWinters function

2009-10-28 Thread Nichenametla, Karthik K
Hi David, I am facing some issues with the HoltWinters function in R (v2.9.2). I am doing time series analysis using this method. For the time series data that I used, (alpha,beta,gamma) parameters came out to be (1,0,0). I think this theoretically should mean that the predicted timeseries

Re: [R] Non-normal residuals.

2009-10-28 Thread Ravi Varadhan
There is also the tlm() function in hett package for fitting linear models under t-distributed, heteroscedastic errors. Ravi. --- Ravi Varadhan, Ph.D. Assistant Professor, The Center on Aging and Health Division

Re: [R] Non-normal residuals.

2009-10-28 Thread Kjetil Halvorsen
On Wed, Oct 28, 2009 at 7:25 AM, David Scott d.sc...@auckland.ac.nz wrote: Karl Ove Hufthammer wrote: On Tue, 27 Oct 2009 18:06:02 -0400 Ben Bolker bol...@ufl.edu wrote:  If transforming your data brings you closer to satisfying the assumptions of your analytic methods and having a sensible

Re: [R] MLE for lambda of Poisson distribution using fitdistr

2009-10-28 Thread Terry Therneau
In general Poisson data consists of a pair of numbers (y,n), where y is the event count for the unit and n is the size of the unit. The Poisson MLE is sum(y)/sum(n). A general example is county level data where y is the number of events (rare cancer) and n is the county size. Two special cases

Re: [R] Creating a sparse matrix from a file

2009-10-28 Thread Martin Maechler
PP == Pallavi P pallavip...@gmail.com on Wed, 28 Oct 2009 16:30:25 +0530 writes: PP Hi Martin, PP I followed your example on my set of data. Which has non zero values in PP 300k positions in 22638 X 80914 sparse matrix. I am able to load data into a PP field and was able

Re: [R] GGPLOT2 Different Layers Different X Values

2009-10-28 Thread Hadley Wickham
Hi John, Could you please provide a small reproducible example? Thanks, Hadley Sent from my iPhone On 26/10/2009, at 6:50 PM, Jonathan Bleyhl jonathan_ble...@affymetrix.com wrote: I'm trying to plot values based on a date and then overlay a histogram also by date. The problem is that

[R] Regex matching that gives byte offset?

2009-10-28 Thread Johannes Graumann
Hi, Is there any way of doing 'grep' ore something like it on the content of a text file and extract the byte positioning of the match in the file? I'm facing the need to access rather largish (600MB) XML files and would like to be able to index them ... Thanks for any help or flogging, Joh

[R] Reading data

2009-10-28 Thread Val
Hi User's, This might be a simple question but it is giving me a hard time as I am a new user. I installed R version 2.9.2 (2009-08-24) 1. I just copied a short script from Fox (2002) as a practice and wanted to save it as Rossi.R. The system saved it without complain but when I looked at

Re: [R] Antropometrics with R

2009-10-28 Thread David Winsemius
You might want to take a look at this article by WEI, PERE, KOENKER, AND HE. Its in the research files of Koenker who is a regular contributor to R-help: http://www.econ.uiuc.edu/~roger/research/growth/growth.pdf In particular it mentions lmsqreg, which would be a package that implements

Re: [R] Reading data

2009-10-28 Thread Tal Galili
Hi Val, I am not sure what it is that you are trying to do. read.table Is not used to open an R script, but to open a data file. You will also need to give the extension of the file when using the command (someone please correct me if I am wrong). If you wish to open an R script, I would just

Re: [R] cross-over designs

2009-10-28 Thread Peter Dalgaard
Data Analytics Corp. wrote: Hi, I have a dataset from a client where the data is from a cross-over design. Basically, each subject in a survey was asked to rate two products, A and B. The subject sampled A first and then after an appropriate wash-out period he/she sampled B. The next

Re: [R] Reading data

2009-10-28 Thread Vassilis Golfinopoulos
Hi Val, Windows does not display extensions by default. Check the 'Type' column; it should read 'R file'. Keep in mind what you are dealing with; Rossi.R is a script, so you cannot open it with read.table. You have to use source() for that. Moreover, use the extension, as well (Rossi.R, not

Re: [R] Reading data

2009-10-28 Thread David Winsemius
On Oct 28, 2009, at 10:04 AM, Val wrote: Hi User's, This might be a simple question but it is giving me a hard time as I am a new user. I installed R version 2.9.2 (2009-08-24) 1. I just copied a short script from Fox (2002) as a practice and wanted to save it as Rossi.R. How?

Re: [R] regression on large file

2009-10-28 Thread Benilton Carvalho
bigmemory and biglm packages may be of your interest. b On Oct 28, 2009, at 8:50 AM, Georg Ehret wrote: Dear R community, I have a fairly large file with variables in rows. Every variable (thousands) needs to be regressed on a reference variable. The file is too big to load into R (or R

[R] structural equation modeling

2009-10-28 Thread Robert Terwilliger
Dear R-help, I am interested in using structural equation modeling. Just getting started with it, but I'm looking for suggestions for packages. As an aside, what's the best way for looking for packages at CRAN? -- Robert Terwilliger Biomedical Physicist Laboratory of Neurocognitive

Re: [R] structural equation modeling

2009-10-28 Thread Duncan Murdoch
On 10/28/2009 10:37 AM, Robert Terwilliger wrote: Dear R-help, I am interested in using structural equation modeling. Just getting started with it, but I'm looking for suggestions for packages. As an aside, what's the best way for looking for packages at CRAN? The task views are great: see

Re: [R] cross-over designs

2009-10-28 Thread Peter Dalgaard
Peter Dalgaard wrote: Data Analytics Corp. wrote: Hi, I have a dataset from a client where the data is from a cross-over design. Basically, each subject in a survey was asked to rate two products, A and B. The subject sampled A first and then after an appropriate wash-out period he/she

Re: [R] structural equation modeling

2009-10-28 Thread Viechtbauer Wolfgang (STAT)
There is the 'sem' package: http://cran.r-project.org/web/packages/sem/index.html The task views (http://cran.r-project.org/web/views/) are often a good place to start when looking for particular techniques/methods. Best, -- Wolfgang Viechtbauerhttp://www.wvbauer.com/

[R] please join the R group on LinkedIn

2009-10-28 Thread Ajit de Silva
LinkedIn is a professional networking site but we have discussions and news items as well. We have over fifteen hundred group members. http://www.linkedin.com/groups?about=gid=77616trk=anet_ug_grppro -- _ Ajit Gemunu de Silva Oakland CA 94619 skype:

Re: [R] ggplot2: stat_bin ..count.. with geom_text when NA is present

2009-10-28 Thread hadley wickham
Hi Bryan, Thanks for the reproducible example. The problem is actually in your code, not mine ;) You probably want: y = min(res, na.rm = TRUE) - 0.1 * diff(range(res, na.rm = TRUE)) Hadley (drop = TRUE solves a difference problem - it controls whether or not to remove bins with zero count)

Re: [R] Reading data

2009-10-28 Thread Val
The working directory is getwd() [1] C:/Documents and Settings/Val/My Documents The data file(Rossi.dat) and the script(Rossi.R) are in C:/Documents and Settings/Val/My Documents/R_data/prd How should I write to read the file? source(???) # what should be included here? Rossi -

Re: [R] Anthropometric calculations with R

2009-10-28 Thread David Winsemius
On Oct 28, 2009, at 10:18 AM, David Winsemius wrote: You might want to take a look at this article by WEI, PERE, KOENKER, AND HE. Its in the research files of Koenker who is a regular contributor to R-help: http://www.econ.uiuc.edu/~roger/research/growth/growth.pdf In particular it

Re: [R] Anthropometric calculations with R

2009-10-28 Thread Shige Song
Dear David, This information is very helpful, thanks. Best, Shige On Wed, Oct 28, 2009 at 10:55 AM, David Winsemius dwinsem...@comcast.netwrote: On Oct 28, 2009, at 10:18 AM, David Winsemius wrote: You might want to take a look at this article by WEI, PERE, KOENKER, AND HE. Its in the

Re: [R] Reading data

2009-10-28 Thread Vassilis Golfinopoulos
Val, please take it slow, you are missing basic stuff here. (1) Windows Explorer may hide extensions; the 'Type' column should read 'R file' anyway. (2) Script files are included in your workspace with the comand source(). Please type ?source for details. (3) You should call files with their

[R] Question on Bias calculations and question on read.fwf

2009-10-28 Thread Vadlamani, Satish {FLNA}
Hi All: Bear with me on this longer e-mail. Questions: 1) Can you share with me on any example code that you may have that calculates bias of a statistical forecast in a time series? 2) Supposed I have the file in the fixed width format (details below). 1-62 character key 63-76 sales data point

[R] Data Partition Package

2009-10-28 Thread Xu
Hi, Users, I am a new user. I am trying to partition data into training and test. Is there any R package or function that can partition dataset? Also, is there any package do crossvalidation? Any help will be appreciated. Best, Pat [[alternative HTML version deleted]]

Re: [R] how do I plot a regression curve with the data?

2009-10-28 Thread Tom Gottfried
?curve regards, Tom Ken Ervin schrieb: I have a data set of 6 or so ordered pairs, and I've been able to graph them and have decided to use a high-order polynomial regression. I've used the following piece of code: regression - function(x,y) { x - c(insert_numbers_here) y -

Re: [R] Regex matching that gives byte offset?

2009-10-28 Thread Prof Brian Ripley
Do you mean like regexpr() (on the same help page)? Depending on your locale, you might actually prefer the character offset: if you want to match in a MBCS and have byte offsets you will need to work a bit harder if useBytes=TRUE is not sufficient for you. On Wed, 28 Oct 2009, Johannes

Re: [R] Data Partition Package

2009-10-28 Thread Max Kuhn
There are a few. I'm partial to the function in the caret package: createDataPartition. Also, there are functions there for pre-processing on training sets and applying it to new data sets. For a somewhat dated summary of the packages, see: http://www.jstatsoft.org/v28/i05 also:

Re: [R] Reading data

2009-10-28 Thread David Winsemius
On Oct 28, 2009, at 10:55 AM, Val wrote: The working directory is getwd() [1] C:/Documents and Settings/Val/My Documents The data file(Rossi.dat) and the script(Rossi.R) are in C:/Documents and Settings/Val/My Documents/R_data/prd So you are not giving a proper path when you issue the

Re: [R] how do I plot a regression curve with the data?

2009-10-28 Thread Kingsford Jones
On Wed, Oct 28, 2009 at 9:23 AM, Tom Gottfried tom.gottfr...@wzw.tum.de wrote: ?curve regards, Tom and I was in the process of writing a curve example when I noticed Tom sent this. Here it is: set.seed(777) x - runif(100, 0, 100) y - 10*x + x^2 - .01*x^3 + rnorm(100, 0, 500) fit - lm(y ~ x

[R] Lost all script

2009-10-28 Thread David Young
Hi all, I just had a rather unpleasant experience. After considerable work I finally got a script working and set it to run. It had some memory allocation problems when I came back so I used Windows to stop it. During that process it told me that the script had been changed and asked if I

Re: [R] x11(title=' ')

2009-10-28 Thread Greg Snow
The general way to create a title for multiple plots on the same page is to first create some room for the title by setting the outer margins (using par(oma=...)), then use mtext or title with the outer=TRUE argument to place the overall title. -- Gregory (Greg) L. Snow Ph.D. Statistical Data

Re: [R] Reading data

2009-10-28 Thread Val
Val, please take it slow, you are missing basic stuff here. (1) Windows Explorer may hide extensions; the 'Type' column should read 'R file' anyway. * Yes I looked at it and it only shows type. To check I downloaded another script with R extension test.R and the type column shows the

[R] Kruskal-Wallis test and kruskalmc

2009-10-28 Thread KEL
Dear all, I am using the Kruskal-Wallis test in R (kruskal.test()) to compare non-normally distributed observations for 5 different groups. I now want to perform multiple comparisons to identify the groups with significant differences in the mean ranks. On searching the forum I found a number of

Re: [R] cox regression extract strata as numeric

2009-10-28 Thread Terry Therneau
-- begin included message --- (basehazzft.ln$stra[285]) [1] stra=2 134 Levels: stra=1 stra=10 stra=100 stra=101 stra=102 ... stra=99 c(basehazzft.ln$stra[285]) [1] 47 while the desired value is 2, I get a 47. What am I doing wrong? I tried the as.numeric function but I have the same problem..

[R] Labelling individual points on 3D PCA scatterplot

2009-10-28 Thread trz
Hi There, I'm attempting to plot 10 values on a three-dimensional PCA with text labels next to each point. While i have no trouble doing this on 2D plots using the 'text' or 'textxy' function, I cannot find a function to do this on a 3D plot. I am using princomp for my PCA:

Re: [R] Data Partition Package

2009-10-28 Thread Xu
Thanks a lot. Have a nice day! Best, Pat On Wed, Oct 28, 2009 at 10:29 AM, Max Kuhn mxk...@gmail.com wrote: There are a few. I'm partial to the function in the caret package: createDataPartition. Also, there are functions there for pre-processing on training sets and applying it to new data

Re: [R] Reading data

2009-10-28 Thread Peter Ehlers
David Winsemius wrote: On Oct 28, 2009, at 10:55 AM, Val wrote: The working directory is getwd() [1] C:/Documents and Settings/Val/My Documents The data file(Rossi.dat) and the script(Rossi.R) are in C:/Documents and Settings/Val/My Documents/R_data/prd So you are not giving a proper

Re: [R] Lost all script

2009-10-28 Thread Duncan Murdoch
On 10/28/2009 11:37 AM, David Young wrote: Hi all, I just had a rather unpleasant experience. After considerable work I finally got a script working and set it to run. It had some memory allocation problems when I came back so I used Windows to stop it. During that process it told me that the

Re: [R] Reading data

2009-10-28 Thread David Winsemius
On Oct 28, 2009, at 11:46 AM, Val wrote: Val, please take it slow, you are missing basic stuff here. (1) Windows Explorer may hide extensions; the 'Type' column should read 'R file' anyway. * Yes I looked at it and it only shows type. To check I downloaded another script with R

Re: [R] Antropometrics with R

2009-10-28 Thread S Ellison
The gamlss package, by Mikis Stasinopoulos and available at http://www.gamlss.com/ as well as from CRAN, is also very flexible, allowing shape and scale adjustment. Steve E David Winsemius dwinsem...@comcast.net 28/10/2009 14:18 You might want to take a look at this article by WEI, PERE,

Re: [R] Lost all script

2009-10-28 Thread Adaikalavan Ramasamy
To stop in Rgui mode, you can try pressing the ESC key. If you are using within emacs, change to R buffer and try C-c C-c to stop it. I am not sure how to recover the script (emacs usually makes a .R~ backup). Maybe if you still have the output printed to screen or terminal make a copy of it

[R] Standard Time Stamps

2009-10-28 Thread Sunita22
Hello I have a data set which contains a column of Standard Time Stamps (2008-09-12T23:48:07.747Z, 2008-09-12T20:35:07.747Z, etc) I need to find differences in consecutive time stamps and then need to plot a graph using it, can anyone guide me as to how to handle this type of data? Thanks in

[R] Selecting rows according to a column

2009-10-28 Thread Gurpal Kalsi
Hi, With a data such as: z = data.frame(a = 1:5, b=10*a, c = c(a, a, b, b, b) ) * a b c* *1* 10 *a* *2* 20 *a* 3 *30* *b* 4 *40* *b* 5 *50* *b* Can anyone suggest a way to select [1, 2, 30, 40, 50], ie. using column c to specify which column is selected for each row. Many thanks G

Re: [R] Standard Time Stamps

2009-10-28 Thread jim holtman
How about this: x - c(2008-09-12T23:48:07.747Z, 2008-09-12T20:35:07.747Z) x.t - as.POSIXct(x, format=%Y-%m-%dT%H:%M:%OS) x.t [1] 2008-09-12 23:48:07 EDT 2008-09-12 20:35:07 EDT diff(x.t) Time difference of -3.216667 hours On Wed, Oct 28, 2009 at 12:11 PM, Sunita22 sunita...@gmail.com

Re: [R] Standard Time Stamps

2009-10-28 Thread Sunita Patil
Hello Jim Thanx a lot. Actually since long I was trying dts = c(1989-09-28, 2001-01-15, 2004-08-30, 1990-02-09) dts [1] 1989-09-28 2001-01-15 2004-08-30 1990-02-09 GMT = timeDate(dts, zone = GMT, FinCenter = GMT) GMT GMT [1] [1989-09-28] [2001-01-15] [2004-08-30] [1990-02-09]

Re: [R] Reading data

2009-10-28 Thread Val
On Wed, Oct 28, 2009 at 11:59 AM, David Winsemius dwinsem...@comcast.netwrote: On Oct 28, 2009, at 11:46 AM, Val wrote: Val, please take it slow, you are missing basic stuff here. (1) Windows Explorer may hide extensions; the 'Type' column should read 'R file' anyway. * Yes I looked

Re: [R] Selecting rows according to a column

2009-10-28 Thread Erik Iverson
Hello, Here's an idea: ifelse(z$c == a, z$a, z$b) -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Gurpal Kalsi Sent: Wednesday, October 28, 2009 11:15 AM To: r-help@r-project.org Subject: [R] Selecting rows according to a

Re: [R] structural equation modeling

2009-10-28 Thread Ista Zahn
There is a package in beta testing now that looks interesting: http://openmx.psyc.virginia.edu/installing-openmx -Ista On Wed, Oct 28, 2009 at 10:37 AM, Robert Terwilliger rater...@gmail.com wrote: Dear R-help, I am interested in using structural equation modeling. Just getting started

Re: [R] Selecting rows according to a column

2009-10-28 Thread Adaikalavan Ramasamy
Not very elegant but try: z - data.frame(a = 1:5, b=10*(1:5), c = c(a, a, b, b, b) ) z[ cbind( 1:nrow(z), match( as.character(z$c) , colnames(z) ) ) ] If you have very few columns, you can use ifelse() too. Regards, Adai Gurpal Kalsi wrote: Hi, With a data such as: z = data.frame(a =

[R] Need help locating the longest series of consecutive numbers in a matrix

2009-10-28 Thread Staples, Angela Dawn
I need to determine the length of the longest series of consecutive numbers (1's to be specific) and the start time of that series. For example, in the following sample, the first column is time and the second column indicates the presence of the target behavior. I would like a function that

Re: [R] Selecting rows according to a column

2009-10-28 Thread William Dunlap
-Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Erik Iverson Sent: Wednesday, October 28, 2009 9:22 AM To: Gurpal Kalsi; r-help@r-project.org Subject: Re: [R] Selecting rows according to a column Hello, Here's an idea:

[R] Easy method to set user-mode virtual memory space in Windows Vista and 7

2009-10-28 Thread Kingsford Jones
I thought I'd share this with the list since it appears to provide a quick fix to some memory problems, and I haven't see it discussed in relation to R. To reallocate virtual memory from kernel-mode to user-mode in 32-bit Vista or Windows 7 one can use the increaseuserva boot option value. See

Re: [R] New variables remember how they were created?

2009-10-28 Thread Adaikalavan Ramasamy
Your example is too complicated for me. But few points: 1) What do you mean by instrument? Do you mean variable? 2) diff(demand) is identical to demand[-1] - demand[-204] 3) system() is a built-in R function, so avoid using it as variable name 4) The variable yd is in the eqInvest formula and

[R] Why is package RandomFields not listed in the R 2.10.0 Packages list under Packages, Install package(s)...?

2009-10-28 Thread morphwj
The package list was accessed October 28, 10:13 am MST using Windows XP and mirror USA (CA 1). Bill Morphet, Ph.D. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] Selecting rows according to a column

2009-10-28 Thread Gurpal Kalsi
Thanks very much! Gurpal Centrica Energy. On Wed, Oct 28, 2009 at 4:31 PM, William Dunlap wdun...@tibco.com wrote: -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Erik Iverson Sent: Wednesday, October 28, 2009 9:22 AM

Re: [R] ggplot2: stat_bin ..count.. with geom_text when NA is present

2009-10-28 Thread Bryan Hanson
Hadley, thanks - that was a permutation that I did not try (but should have thought of it). But... Now, when some observations are removed, you get the count on the plot (previously one did not), however, alas, a new problem: the value of .count.. includes the NA's or something similar.

Re: [R] Creating a sparse matrix from a file

2009-10-28 Thread Pallavi P
Hi Martin, Unfortunately, the error is coming on the data set that I have right now. I was successfully able to display any field in the matrix and even the whole matrix when I tried the example code provided by you. However, it is failing on the dataset I am working on.I can share the file with

[R] Is there a faster way to do it?

2009-10-28 Thread Marcio Resende
#Mdarts is a matrix 2343x788 #frequencia is a vector 2343x1 # 9 in Mdarts[fri,frj] stands for my missing values which i want to replace by the value in the vector frequencia Mdarts-t(matrix(scan(C:/GWS/CNB/dartg.txt),ncol=nindT,nrow=nm, byrow=T)) frequencia -

Re: [R] Need help locating the longest series of consecutive numbers in a matrix

2009-10-28 Thread jim holtman
Use 'rle': x - rle(sample[,2]) x Run Length Encoding lengths: int [1:9] 10 3 3 1 1 1 1 17 3 values : num [1:9] 0 1 0 1 0 1 0 1 0 which.max(x$lengths[x$values==1]) [1] 4 which.max(x$lengths * x$values) # makes use of the fact you are only using 0 1 [1] 8 cumsum(c(1, x$lengths)) [1]

  1   2   >