Re: [R] Problem with RODBC

2011-07-19 Thread Dieter Menne
David Scott-6 wrote: > > I have been trying to read some data from an Excel workbook without > success. > ... > > faults <- sqlFetch(channel, sqtable = 'Data', > +colnames = FALSE, as.is = TRUE) > > faults > [1] "HY001 -1040 [Microsoft][ODBC Excel Driver] Too many fields de

Re: [R] list.files recursively to find files in a specific way...

2011-07-19 Thread Prof Brian Ripley
But using the approproate tool, Sys.glob, whould be much simpler. Note that 'pattern' in list.files is - a regexp, and '.' is a special character in a regexp: Phil's solution also needs to escape it or use fixed = TRUE - it is documented to match file *names*, not file paths. One of the autho

[R] Problem with RODBC

2011-07-19 Thread David Scott
I have been trying to read some data from an Excel workbook without success. The workbook is in .xls format and has multiple sheets, one with the sheet name Data, which is the sheet I wish to read from. One complication is that the header row of this sheet is comprised of dropdown boxes. I tr

Re: [R] loops and simulation

2011-07-19 Thread Daniel Malter
Yes, there are in Europe. And there are summer classes in the US, as well. And no, this list is not so much about helping beginners to learn R. For that, there is a myriad of online sources. Rather, this list is for people who have exhausted their ability to (elegantly) solve a problem. Also, it s

Re: [R] How to convert number (matlab) to date

2011-07-19 Thread John
On Monday, July 18, 2011 05:56:14 peter dalgaard wrote: > but even this is dubious, since there is no year 0 AD. In Gregorian and > Julian calendars, 1 BC continues directly into 1 AD. > Although this seems to be a widely recognized "problem," I would argue it is an entirely specious one. It m

Re: [R] PCA - princomp can only be used with more units than variables

2011-07-19 Thread Joshua Wiley
On Mon, Jul 18, 2011 at 10:48 AM, a.me...@yahoo.co.uk wrote: > Ok thank you Josh. > > Basically I have a matrix A with 7 rows and 18 columns. If i < j (where i is the number of rows in your matrix and j is the number of columns), then the determinant of the covariance (or correlation) matrix |Sig

Re: [R] Different result of multiple regression in R and SPSS

2011-07-19 Thread Daniel Malter
First, it would have helped if you had posted the actual results for us to see how far they are off (and, more specifically, by which factor). Second, given your epiphany, you will find that that's exactly what David (and others before him) said or suggested. It is not about standardizing a nomina

Re: [R] Different result of multiple regression in R and SPSS

2011-07-19 Thread Spencer Graves
On 7/19/2011 4:04 PM, Bert Gunter wrote: On Tue, Jul 19, 2011 at 3:45 PM, David Winsemius wrote: On Jul 19, 2011, at 6:29 PM, J. wrote: Thanks for the answer. # However, I am still curious about which result I should use? The result from R or the one from SPSS? It

Re: [R] Taking all "complete" diagonals of a matrix

2011-07-19 Thread Peter Lomas
Thanks very much to everyone who replied. Peter got me on my way with the use diag() hint, and I came with a less pretty version of Dan's first option almost at the same time as I got that email. Seems I can't avoid one for loop, but one is better than two. Just as a note, with this code you hav

Re: [R] notation question

2011-07-19 Thread Carson Farmer
Thank you Rolf, >> Using the analysis of co-variance example from MASS (fourth edition, p >> 142), what is the correct notation for the formula "Gas, ~ Insul/Temp >    There shouldn't be a comma after ``Gas'' in that formula. >> - 1"? Obviously, if we fit it as two separate models (as in the >> exa

[R] SSOAP & chemspider

2011-07-19 Thread Benton, Paul
Dear all, I've been trying on and off for the past few months to get SSOAP to work with chemspider. First I tried the WSDL file: cs<-processWSDL("http://www.chemspider.com/MassSpecAPI.asmx?WSDL";) Error in parse(text = paste(txt, collapse = "\n")) : :1:29: unexpected input 1: function(x, ...,

Re: [R] notation question

2011-07-19 Thread Rolf Turner
On 20/07/11 07:24, Carson Farmer wrote: Dear list, I am currently writing up some of my R models in a more formal sense for a paper, and I am having trouble with the notation. Although this isn't really an 'R' question, it should help me to understand a bit better what I am actually doing when fi

Re: [R] Taking all "complete" diagonals of a matrix

2011-07-19 Thread Dennis Murphy
Hi: Does this work for you? mydiags <- function(mat) diag(mat[seq_len(ncol(mat)), ]) # Example: set.seed(103) u <- matrix(rpois(200, 10), ncol = 10) # > dim(u) # [1] 20 10 mydiags(u) # [1] 7 12 6 13 12 6 5 6 14 6 u[1:10, ] # as a double check HTH, Dennis On Tue, Jul 19, 2011 at 2:15

Re: [R] calculating mean excluding zeros

2011-07-19 Thread Sarah Goslee
On Tue, Jul 19, 2011 at 5:20 PM, Dimitri Liakhovitski wrote: > Thanks a lot, Sarah. > I assume, if the values against which I am comparing are REALLY zero > ("0") - then even the first one (mean(testvec[testvec != 0])) should > work, right? > Dimitri Well, yes. But what's "really" zero? > ((.2 +

Re: [R] Assigning colors to cells

2011-07-19 Thread Dennis Murphy
Use the cut() function to produce the interval categories and color names in the data frame and then pass that variable to the col = argument in the appropriate plot function. Something like mydata$mycolors <- cut(mydata$value, c(-Inf, 1, 2, 3, Inf), label = c('blue', 'green', 'yellow')) Ask an a

Re: [R] Different result of multiple regression in R and SPSS

2011-07-19 Thread Mike Marchywka
> From: dwinsem...@comcast.net > To: seoulseoulse...@gmail.com > Date: Tue, 19 Jul 2011 18:45:47 -0400 > CC: r-help@r-project.org > Subject: Re: [R] Different result of multiple regression in R and SPSS > > > On Jul 19, 2011, at 6:29 PM, J. wrote: > > >

Re: [R] Taking all "complete" diagonals of a matrix

2011-07-19 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Peter Lomas > Sent: Tuesday, July 19, 2011 2:16 PM > To: r-help@r-project.org > Subject: [R] Taking all "complete" diagonals of a matrix > > Hi R-Help! > > I am trying to find a

Re: [R] Different result of multiple regression in R and SPSS

2011-07-19 Thread Bert Gunter
On Tue, Jul 19, 2011 at 3:45 PM, David Winsemius wrote: > > On Jul 19, 2011, at 6:29 PM, J. wrote: > >> Thanks for the answer. >> # >> However, I am still curious about which result I should use? The result >> from >> R or the one from SPSS? > > It is becoming apparent tha

Re: [R] list.files recursively to find files in a specific way...

2011-07-19 Thread Phil Spector
Pei - A file pattern can't contain a directory separator, but it's easy to search for one outside the context of list.files. I think grep('B/file2.txt',list.files(path = routeStr, all.files = TRUE, full.names = TRUE, recursive = TRUE),value=TRUE) should give y

Re: [R] Different result of multiple regression in R and SPSS

2011-07-19 Thread David Winsemius
On Jul 19, 2011, at 6:29 PM, J. wrote: Thanks for the answer. However, I am still curious about which result I should use? The result from R or the one from SPSS? It is becoming apparent that you do not know how to use the results from either system. The progress of science would be saf

[R] list.files recursively to find files in a specific way...

2011-07-19 Thread JIA Pei
Hi, all: My folders are organized in such a way: root branch1 ---A ---file1.txt ---file2.txt ---B ---file1.txt ---file2.txt branch2 ---A ---file1.txt

Re: [R] Different result of multiple regression in R and SPSS

2011-07-19 Thread Dimitri Liakhovitski
I don't think SPSS does anything with the variables you enter there. Have you entered it as numeric? Have you entered gender as numeric in R? On Tue, Jul 19, 2011 at 6:11 PM, Bert Gunter wrote: > Answer: Contrasts, i.e. the parameterization of the categorical variable(s) > df. > > ?contrasts may

Re: [R] Different result of multiple regression in R and SPSS

2011-07-19 Thread J.
Thanks for the answer. However, I am still curious about which result I should use? The result from R or the one from SPSS? Why the results from two programs are different? Jay -- View this message in context: http://r.789695.n4.nabble.com/Different-result-of-multiple-regression-in-R-and-SPSS-t

Re: [R] Different result of multiple regression in R and SPSS

2011-07-19 Thread Bert Gunter
Answer: Contrasts, i.e. the parameterization of the categorical variable(s) df. ?contrasts may be of some help, but you really need to do some background studying of the linear models principles involved. Googling may provide tutorials. Also searching the mail archives, e.g.: https://stat.ethz.ch

[R] Different result of multiple regression in R and SPSS

2011-07-19 Thread J.
Hi, I am trying to do a simple multiple regression analysis that has one nominal variable (gender) and three numeric variables as independent variables and one numeric variable as dependent variable. So, I got a formula like this: summary(out.3 <- lm(scale(DV) ~ gender + scale(IV.1) + scale(IV.2)

[R] Taking all "complete" diagonals of a matrix

2011-07-19 Thread Peter Lomas
Hi R-Help! I am trying to find a nicer way of extracting all the "complete" diagonals of a matrix. I am working with very large matrices that have many more rows than columns. I want to be able to extract each of the diagonals that are as long as the number of columns in the matrix. I have writ

[R] Incorrect degrees of freedom for splines using GAMM4?

2011-07-19 Thread Melinda Power
Hello, I'm running mixed models in GAMM4 with 2 (non-nested) random intercepts and I want to include a spline term for one of my exposure variables. However, when I include a spline term, I always get reported degrees of freedom of less than 1, even when I know that my spline is using more than 1

[R] Error in vector("double", length) : cannot allocate vector of length 1010723280 - need help

2011-07-19 Thread kinnari
Hi All, I am working on CGH datasets. When I am running clustering, it shows me this error. d <- dist(mydata, method = "euclidean") Error in vector("double", length) : cannot allocate vector of length 1010723280 If anyone can help me, I will really appreciate. Thanks, Kinnari -- View this me

Re: [R] timeDate with month designated by three letters.

2011-07-19 Thread Clint Bowman
strptime("04-MAY-11 1428",format="%d-%b-%y %H%M") [1] "2011-05-04 14:28:00" -- Clint BowmanINTERNET: cl...@ecy.wa.gov Air Quality Modeler INTERNET: cl...@math.utah.edu Department of Ecology VOICE: (360) 407-6815 PO Box 47600

Re: [R] calculating mean excluding zeros

2011-07-19 Thread Bert Gunter
Sarah et. al: On Tue, Jul 19, 2011 at 1:56 PM, Sarah Goslee wrote: > In the more general case, that approach is prone to machine precision > error (FAQ 7.31). > > Here's a clunky but safer alternative: > Perhaps ?zapsmall . However, I would agree with your sentiments that it may depend on conte

[R] Assigning colors to cells

2011-07-19 Thread Sumukh Sathnur
Hi everyone, I was wondering if there was a simple way to assign a color to a cell based on value in a data frame and return the cell as an image? For example, if the value is >1, then blue, if between 1 and 2, green, if between 2 and 3, yellow, etc. I tried using a heatmap function but I wa

Re: [R] comparing SAS and R survival analysis with time-dependent covariates

2011-07-19 Thread Thomas Lumley
On Wed, Jul 20, 2011 at 5:42 AM, AO_Statistics wrote: > > Terry Therneau-2 wrote: >> >> This query of "why do SAS and S give different answers for Cox models" >> comes >> up every so often.  The two most common reasons are that >>       a. they are using different options for the ties >>       b.

Re: [R] calculating the mean of a random matrix (by row) and some general questions

2011-07-19 Thread David Winsemius
On Jul 19, 2011, at 4:18 PM, Peter Lomas wrote: Hi Richard, As others have said, try to use the "apply" functions rather than loops. There is also an apply function for lists, see ?lapply. This is much more efficient. Actually the "apply" functions are not "more efficient" in the usual

Re: [R] loops and simulation

2011-07-19 Thread Daniel Malter
I dare the conjecture that if you had written the code, you would know how to do this. This suggests that you are asking us to do your homework, which is not the purpose of this list. A simple inclusion of the code in a for or while loop and storing the estimated parameters with the index of the it

Re: [R] calculating mean excluding zeros

2011-07-19 Thread Dimitri Liakhovitski
Thanks a lot, Sarah. I assume, if the values against which I am comparing are REALLY zero ("0") - then even the first one (mean(testvec[testvec != 0])) should work, right? Dimitri On Tue, Jul 19, 2011 at 4:56 PM, Sarah Goslee wrote: > In the more general case, that approach is prone to machine pr

Re: [R] timeDate with month designated by three letters.

2011-07-19 Thread Peter Alspach
Tena koe Michael The help file for strptime suggests you should be using %b (three letter month) rather than %m (decimal number month). HTH Peter Alspach > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of mdkz...@aol.com

Re: [R] How to get predicted values of y for different x values?

2011-07-19 Thread Daniel Malter
Please read the posting guide (requires a self-contained example of code) and consult the help pages before posting. If you type ?predict.lm the help page clearly states that the argument 'newdata' takes "[a]n optional data frame in which to look for variables with which to predict..." x1<-rnorm(1

[R] hold position of vertices constant in network {statnet}?

2011-07-19 Thread Matt Bakker
I am a novice with network fuctions! I have been exploring the network function in the statnet package, but haven't been able to figure out how to hold vertices in position while varying edge features. Can anyone advise on whether this is possible, and if so, how to do it? Thanks! -- Matthew Bakke

Re: [R] calculating mean excluding zeros

2011-07-19 Thread Sarah Goslee
In the more general case, that approach is prone to machine precision error (FAQ 7.31). Here's a clunky but safer alternative: > set.seed(1234) > testvec <- sample(0:10, 100, replace=TRUE) > mean(testvec) [1] 4.31 > mean(testvec[testvec != 0]) [1] 4.842697 > mean(testvec[!sapply(testvec, function

Re: [R] calculating mean excluding zeros

2011-07-19 Thread Weidong Gu
You can do it by subsetting or indexing r<-c(0,0,0,rnorm(10,10,5)) > mean(r) [1] 8.052215 > mean(r[r!=0]) [1] 10.46788 Weidong Gu On Tue, Jul 19, 2011 at 4:36 PM, Dimitri Liakhovitski wrote: > Sorry if it's been discussed before - don't seem to find it. > I'd like to calculate a mean while ign

[R] timeDate with month designated by three letters.

2011-07-19 Thread mdkzone
Dear R Experts: I am trying to convert a date and time character field to timeDate where the month is presented as three letters, such as "JUN" for June, etc. This is an example of the full character field: "04-MAY-11 1428" What is the proper format syntax? I've tried timeDate("04-MAY

[R] calculating mean excluding zeros

2011-07-19 Thread Dimitri Liakhovitski
Sorry if it's been discussed before - don't seem to find it. I'd like to calculate a mean while ignoring zeros. "mean" doesn't seem to have an option for that. Any other function/package that could do it? Thanks for a pointer! -- Dimitri Liakhovitski marketfusionanalytics.com __

Re: [R] R on a server (Windows Server 2008)

2011-07-19 Thread Dimitri Liakhovitski
Thanks a lot, Roger! Dimitri On Tue, Jul 19, 2011 at 11:00 AM, Bos, Roger wrote: > Yes. I have it running on a win server 2008 machine with no problems. > > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of Dimitri Liakhovitski >

Re: [R] calculating the mean of a random matrix (by row) and some general questions

2011-07-19 Thread Peter Lomas
Hi Richard, As others have said, try to use the "apply" functions rather than loops. There is also an apply function for lists, see ?lapply. This is much more efficient. I also like writing my own functions. For example: f <- function(x) { x^2 } Which can then be used by: > f(2) [1] 4 Thi

Re: [R] calculating the mean of a random matrix (by row) and some general questions

2011-07-19 Thread David Winsemius
On Jul 19, 2011, at 4:03 PM, RichardLang wrote: Thanks for your advice! I found another method to solve my problem (on page 20 of the manual =) ). Here's my code In r-help most of the readers and most of the regular responders are reading this as a mailing list posting not on Nabble

Re: [R] calculating the mean of a random matrix (by row) and some general questions

2011-07-19 Thread RichardLang
Thanks for your advice! I found another method to solve my problem (on page 20 of the manual =) ). Here's my code # Set n and m to whatever you want n = 25 m = 10 # Build a random vector (here with exponential distribution) with lenght of n*m x = rexp(n*m,1) # Set up a factor in order to group

[R] Questions about DCC-GARCH Model

2011-07-19 Thread zoe_zhang
Dear list members, I'm trying to use DCC-GARCH model to estimate the correlation. I have downloeaded ccgarch packeage but can't understand some argument in the formula. dcc.estimation(inia, iniA, iniB, ini.dcc, dvar, model, method="BFGS", gradient=1, message=1) which is on R.Help I understand oth

Re: [R] calculating the mean of a random matrix (by row) and some general questions

2011-07-19 Thread David Winsemius
On Jul 19, 2011, at 2:43 PM, RichardLang wrote: Hi everyone! I'm trying to teach myself R in order to do some data analysis. I'm a mathematics student and (only) familiar with matlab and latex. I'm working trough the "official" introduction to R at the moment, while simultaneously solving

Re: [R] calculating the mean of a random matrix (by row) and some general questions

2011-07-19 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of RichardLang > Sent: Tuesday, July 19, 2011 11:44 AM > To: r-help@r-project.org > Subject: [R] calculating the mean of a random matrix (by row) and some > general questions > > Hi

[R] notation question

2011-07-19 Thread Carson Farmer
Dear list, I am currently writing up some of my R models in a more formal sense for a paper, and I am having trouble with the notation. Although this isn't really an 'R' question, it should help me to understand a bit better what I am actually doing when fitting my models! Using the analysis of co

Re: [R] Stacked Bar Plot in ggplot2

2011-07-19 Thread Justin
Abraham Mathew thisorthat.com> writes: > > I'm trying to develop a stacked bar plot in R with ggplot2. > > My data: > > conv = c(10, 4.76, 17.14, 25, 26.47, 37.5, 20.83, 25.53, 32.5, 16.7, 27.33) > click = c(20, 42, 35, 28, 34, 48, 48, 47, 40, 30, 30) > date = c("July 7", "July 8", "July 9", "

[R] negative binomial regression with spatial weights matrix (not locations)

2011-07-19 Thread ChristyM
Hello, I have some data that exhibits a negative binomial distribution and also spatial structure. I would like to create a model that accounts for both. However, instead of locations, I have a distance matrix (cost matrix) describing the spatial relationships among the locations. I have tried usi

[R] calculating the mean of a random matrix (by row) and some general questions

2011-07-19 Thread RichardLang
Hi everyone! I'm trying to teach myself R in order to do some data analysis. I'm a mathematics student and (only) familiar with matlab and latex. I'm working trough the "official" introduction to R at the moment, while simultaneously solving some exercises I found in the web. Before I post my (pro

Re: [R] How to get predicted values of y for different x values?

2011-07-19 Thread David Winsemius
On Jul 19, 2011, at 2:36 PM, Jeff Newmiller wrote: ?predict Use data.frame() to generate input vectors (newdata) for which you want predicted values. The OP probably needs to use expand.grid to generate the spanning combinations of x values. He will in addition need to include values f

Re: [R] How to get predicted values of y for different x values?

2011-07-19 Thread Jeff Newmiller
?predict Use data.frame() to generate input vectors (newdata) for which you want predicted values. --- Jeff Newmiller The . . Go Live... DCN: Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Eng

Re: [R] barplot question

2011-07-19 Thread Sarah Goslee
People who participate in this list via email are unlikely to have your example data, or even to have any idea what you are currently referring to. Please leave enough of the previous messages in your reply to the list to provide context, and include all necessary information. Don't assume that ev

Re: [R] Plotting intraday data in quantmod

2011-07-19 Thread Joshua Ulrich
On Tue, Jul 19, 2011 at 11:31 AM, kev946 wrote: > I'm using this to plot the data with success, but am unable to figure out how > to get the H:M:S timestamp included with their respective Dates. Any > suggestions? > > xts(Dataset[,-1],as.Date(Dataset[,1],"%Y-%m-%d")) > This is not a plot command.

[R] Stacked Bar Plot in ggplot2

2011-07-19 Thread Abraham Mathew
I'm trying to develop a stacked bar plot in R with ggplot2. My data: conv = c(10, 4.76, 17.14, 25, 26.47, 37.5, 20.83, 25.53, 32.5, 16.7, 27.33) click = c(20, 42, 35, 28, 34, 48, 48, 47, 40, 30, 30) date = c("July 7", "July 8", "July 9", "July 10", "July 11", "July 12", "July 13", "July 14", "Jul

[R] How to get predicted values of y for different x values?

2011-07-19 Thread halptekin
Here is my model with interaction terms and control variables (I changed variables names for easy read): reg1 <- lm(y ~ x1*x2*x3 +control1 + control2 + control3) x1 ranges from 0 to 6; x2 from 0 to 5; and x3 from 0 to 4. All three are discrete ordinal variables; but I will treat them as continu

Re: [R] Plotting intraday data in quantmod

2011-07-19 Thread kev946
I'm using this to plot the data with success, but am unable to figure out how to get the H:M:S timestamp included with their respective Dates. Any suggestions? xts(Dataset[,-1],as.Date(Dataset[,1],"%Y-%m-%d")) -- View this message in context: http://r.789695.n4.nabble.com/Plotting-intraday-data-

Re: [R] why I could not reproduce the Mandelbrot plot demonstrated on R wiki

2011-07-19 Thread belisario
I had the same problem with the code of the Wikipedia in a 64-bit Windows 7. The gif works fine if I use the executable located in bin\x64 instead of bin, which produces the ugly gif eg, in a cmd: \bin\x64\Rscript.exe example.r I realised the solution using the --verbose flag Sorry about my eng

Re: [R] barplot question

2011-07-19 Thread Sally_roman
In my first post is example data. -- View this message in context: http://r.789695.n4.nabble.com/barplot-question-tp3670861p3678402.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch/

Re: [R] comparing SAS and R survival analysis with time-dependent covariates

2011-07-19 Thread AO_Statistics
Terry Therneau-2 wrote: > > This query of "why do SAS and S give different answers for Cox models" > comes > up every so often. The two most common reasons are that > a. they are using different options for the ties > b. the SAS and S data sets are slightly different. > You have bot

Re: [R] Centering data frame by factor

2011-07-19 Thread David Winsemius
On Jul 19, 2011, at 11:58 AM, William Dunlap wrote: -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org ] On Behalf Of Daniel Malter Sent: Tuesday, July 19, 2011 1:51 AM To: r-help@r-project.org Subject: Re: [R] Centering data frame by factor

Re: [R] grey colored lines and overwriting labels i qqplot2

2011-07-19 Thread Brian Diggs
On 7/18/2011 9:23 PM, Sigrid wrote: Hi I apologize for not providing reproducible codes more clearly, and I hope this will be more understandable. I have 14 lines (7 per facet that I would like to add). I will provide you with six of the lines from the data as that should enough data to work wi

Re: [R] Centering data frame by factor

2011-07-19 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf Of Daniel Malter > Sent: Tuesday, July 19, 2011 1:51 AM > To: r-help@r-project.org > Subject: Re: [R] Centering data frame by factor > > > P1-tapply(P1,Experiment,mean)[Experiment

Re: [R] Writing the output of a regression object to a file

2011-07-19 Thread Bert Gunter
If I understand you correctly, > I would like to export the esvr.pred object to a file so that I can > draw a graph of it against my original data in other software that I'm > using. > you cannot do this. You can export **data**, but of course any R "object" is either a binary or text (via dput)

Re: [R] line jump in plot legend title

2011-07-19 Thread Dutrieux , Loïc
I also noticed, after sending the code that the modification does only work when the legend is positioned at the bottom of the figure region , and the function crashes when no title is provided. The modification I applied to the code was intended to be more the solving of a particular problem th

[R] Writing the output of a regression object to a file

2011-07-19 Thread Hanlie Pretorius
Hi, I'm using R 2.12.0 on Windows XP. I've used the e1071 package to tune a Support Vector Regression object and I've created the SVR object: > epsilon.svr <- svm(C8R004 ~.,data = rain_flow.train, scale = T, type = > "eps-regression", + kernel = "radial", cost = 0.9, epsilon=0.55,tolerance=0.00

Re: [R] barplot question

2011-07-19 Thread Robert Baer
As Sarah requested, could you at least read the posting guide and provide us with some sample data? -- Robert W. Baer, Ph.D. Professor of Physiology Kirksville College of Osteopathic Medicine A. T. Still University of Health Sciences 800 W. Jefferson St

Re: [R] Lattice plot problem outputting to jpeg

2011-07-19 Thread Justin
creamers rdeft.nhs.uk> writes: > > Thanks David...I am trying to plot out data for various consultants by > specialty - each specialty has a varying number of consultants - each > consultant a varying number of data pointsI found direct access of the > elements of the dataframe was the only

Re: [R] line jump in plot legend title

2011-07-19 Thread David Winsemius
On Jul 19, 2011, at 10:38 AM, Duncan Murdoch wrote: On 11-07-19 8:16 AM, loic wrote: As suggested by David, I applied some modifications to the code of the legend function so that the legend box size adapts to the number of line jumps in the legend title. Attached the modified code of the

Re: [R] Multiple comparison test on selected contrasts

2011-07-19 Thread B Jessop
Dear Help-list, I have solved the problem by simply deleting the erroneous "0" in the "CR core - CR EC" contrast and deleting the unnecessary command "test=adjusted(summarytype = "single-step")". Regards,B. Jessop > From: deel...@hotmail.com > To: r-help@r-project.org > Date: Sun, 17 Jul 2011

Re: [R] Lattice plot problem outputting to jpeg

2011-07-19 Thread creamers
Thanks David...I am trying to plot out data for various consultants by specialty - each specialty has a varying number of consultants - each consultant a varying number of data pointsI found direct access of the elements of the dataframe was the only way to plot this type of variation, otherwis

Re: [R] Sweave in 2.13.1

2011-07-19 Thread Duncan Murdoch
On 11-07-19 9:42 AM, John Minter wrote: Duncan, thanks for your work. I could not get the workaround you suggested Rterm.exe --no-restore --slave -e utils::Sweave("file.Rnw") to work under 2.13.1 and so gave up and installed the 2.14.0 development build. I can verify that R CMD Sweave file.Rnw

Re: [R] line jump in plot legend title

2011-07-19 Thread Duncan Murdoch
On 11-07-19 8:16 AM, loic wrote: As suggested by David, I applied some modifications to the code of the legend function so that the legend box size adapts to the number of line jumps in the legend title. Attached the modified code of the function. No code was attached. In case you didn't, cou

Re: [R] Sweave in 2.13.1

2011-07-19 Thread John Minter
Duncan, thanks for your work. I could not get the workaround you suggested Rterm.exe --no-restore --slave -e utils::Sweave("file.Rnw") to work under 2.13.1 and so gave up and installed the 2.14.0 development build. I can verify that R CMD Sweave file.Rnw works properly on the 2.14.0 development

Re: [R] Centering data frame by factor

2011-07-19 Thread David Winsemius
On Jul 19, 2011, at 4:50 AM, Daniel Malter wrote: P1-tapply(P1,Experiment,mean)[Experiment] Another way would be with ave(), but I discovered that it does not accept subsidiary arguments and does not issue warnings either, so this works: > with(dfrm, ave(P1, Experiment, FUN=function(x

Re: [R] dead code removal

2011-07-19 Thread Alex Bird
Grand merci! Will try! Kind regards, Alex 2011/7/19 Paul Hiemstra : > e you __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commen

Re: [R] Drawing a histogram from a massive dataset

2011-07-19 Thread Paul Smith
On Tue, Jul 19, 2011 at 12:30 AM, Joshua Wiley wrote: [snip] I guess that I must have a data frame to plot a histogram. >>> >>> Not at all! >>> >>> ## a *vector* of 100 million observation >>> x <- rnorm(10^8) >>> ## a histogram for it (see attached for the result from my system) >>> hist(x)

Re: [R] Lattice plot problem outputting to jpeg

2011-07-19 Thread David Winsemius
On Jul 19, 2011, at 5:40 AM, creamers wrote: Hi.I am relatively new to R but was quite pleased with myself at having generated a series of lattice plots as PDFs. I was very surprised when plotting these out as jpegs (or png or tiff) that the strip title information above each lattice plot

Re: [R] Centering data frame by factor

2011-07-19 Thread ronny
Perfect! Made my day! -- View this message in context: http://r.789695.n4.nabble.com/Centering-data-frame-by-factor-tp3677609p3677665.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.c

Re: [R] line jump in plot legend title

2011-07-19 Thread loic
As suggested by David, I applied some modifications to the code of the legend function so that the legend box size adapts to the number of line jumps in the legend title. Attached the modified code of the function. Thanks to David Regards, Loïc Wageningen University http://r.789695.n4.nabble.c

[R] Lattice plot problem outputting to jpeg

2011-07-19 Thread creamers
Hi.I am relatively new to R but was quite pleased with myself at having generated a series of lattice plots as PDFs. I was very surprised when plotting these out as jpegs (or png or tiff) that the strip title information above each lattice plot vanished. The pdf was fine. Has anybody any ideas?

Re: [R] Understanding R's "Environment" concept

2011-07-19 Thread Duncan Murdoch
On 11-07-18 2:16 PM, Nipesh Bajaj wrote: Hi all, I am trying to understand the R's "environment" concept however the underlying help files look quite technical to me. Can experts here provide me some more intuitive ideas behind this concept like, why it is there, what exactly it is doing in R's a

Re: [R] dead code removal

2011-07-19 Thread Paul Hiemstra
On 07/19/2011 09:57 AM, Juan Carlos Borrás wrote: > Ideally you'd have the next two items available: > - tests that ensure that your code carries out what it should and as it > should. > - a coverage analysis tool that reports what parts of your code have > been and have not been executed by your

Re: [R] dead code removal

2011-07-19 Thread Juan Carlos Borrás
Ideally you'd have the next two items available: - tests that ensure that your code carries out what it should and as it should. - a coverage analysis tool that reports what parts of your code have been and have not been executed by your tests above. Neither of those are mandatory though, but they

Re: [R] urgent Help needed

2011-07-19 Thread Paul Hiemstra
On 07/19/2011 04:40 AM, Ana-Maria Pistea wrote: > >>> B Hi Ana-Maria, A quick google for you error message shows that there can be quite a number of causes for this problem. Therefore it is impossible for us to help you. Please read the R-help posting guide to improve your question [1]. The most

Re: [R] tm: Read a single text file into a corpus as single document?

2011-07-19 Thread Juan Carlos Borrás
Some hints: list.files() will return the list of files in a directory readLines() will allow you to load text files as vectors of lines strsplit() will allow you to break lines into words c(x,y) concatenates vectors x and y ; x <- c(x,y) appends vector y to x unique() will allow you to get rid of r

Re: [R] read.csv help

2011-07-19 Thread Peter Ehlers
On 2011-07-19 01:27, psombe wrote: Well yeah it works fine for small data but when i tried the exact same command with a large data set (abt 167 rows and 4000 columns) it gave me a different data frame. either i get the first column as row names and so when i put data[1,1] i get the the first r

Re: [R] read.csv help

2011-07-19 Thread psombe
Well yeah it works fine for small data but when i tried the exact same command with a large data set (abt 167 rows and 4000 columns) it gave me a different data frame. either i get the first column as row names and so when i put data[1,1] i get the the first row second column data (from the origin

[R] Centering data frame by factor

2011-07-19 Thread ronny
Hi, I would like to center P1 and P2 of the following data frame by the factor "Experiment", i.e. substruct from each value the average of its experiment, and keep the original data structure, i.e. the experiment and the group of each value. RAW= data.frame("Experiment"=c(2,2,2,1,1,1),"Group"=c(

[R] tm: Read a single text file into a corpus as single document?

2011-07-19 Thread Alexander James Rickett
Hello everyone, I'm doing some JGR (a gui frontend for R) development, specifically adding functionality from tm. In order to enable users to select some text files from a file dialog, and turn them into a corpus, I need to be able to generate a corpus using a *SINGLE* text file as a single do

Re: [R] How to convert number (matlab) to date

2011-07-19 Thread Prof Brian Ripley
but even this is dubious, since there is no year 0 AD. In Gregorian and Julian calendars, 1 BC continues directly into 1 AD. True, but these days we are ruled by ISO 8601:2004, which does define a year 0 (the year before 1CE aka 1AD). See http://en.wikipedia.org/wiki/0_(year) . It seems also

Re: [R] Centering data frame by factor

2011-07-19 Thread Daniel Malter
P1-tapply(P1,Experiment,mean)[Experiment] HTH, Daniel ronny wrote: > > Hi, > > I would like to center P1 and P2 of the following data frame by the factor > "Experiment", i.e. substruct from each value the average of its > experiment, and keep the original data structure, i.e. the experiment a

Re: [R] write merged data frame to a file

2011-07-19 Thread Andrea Franceschini
Very Sorry for the instinctive bad comment... I didn't express correctly what I meant. I meant that I would have never expected such behaviour, by default (but may be I am wrong and most of the people need quoting, and hence has sense to put it by default) Problem solved, Philipp guessed right. I

Re: [R] read.csv help

2011-07-19 Thread Rainer Schuermann
Can you explain a little more? I have created a small CSV file following your pattern which looks like this in a text editor: A,B,C,D,E 65,68,71,74,77 67,71,75,79,83 69,73,77,81,85 71,77,83,89,95 When I load it into R with > x <- read.csv( "a.csv" ) I get this which I think is what you would e

Re: [R] Doesnt' winedt 6 version work as Rwinedt?

2011-07-19 Thread erexstad
I am very happy using the R-Sweave plugin that works with WinEdt 6.0. It understands not only R but, as the name suggests, Sweave as well. http://www.winedt.org/Config/modes/R-Sweave.php -- View this message in context: http://r.789695.n4.nabble.com/Doesnt-winedt-6-version-work-as-Rwinedt-tp367

Re: [R] venn diagram in percentage

2011-07-19 Thread poornima
Hi Jim, Thanks for the reply. But i was looking for percentages in venn diagram. Regard's Poornima -- View this message in context: http://r.789695.n4.nabble.com/venn-diagram-in-percentage-tp3664380p3677458.html Sent from the R help mailing list archive at Nabble.com. _

[R] read.csv help

2011-07-19 Thread psombe
Hi, I'm a new R user and I'm having trouble with the read.csv command. It somehow treats the first column as a row name field even though it's not a row name. there are no missing columns/entries and i'm not sure how to resolve this. the format of my data is A, B, C, D,..(3984 columns) 12,

  1   2   >