[R] obtain type I error from modified F statistic

2012-05-29 Thread umai88
i want to find type I error rates using modified F statistic..below is my R code.. h=0 g=0 n=15 alpha=0.1 k=floor(alpha*n)+1 r=k-(alpha*n) i=k+1 m=n-k J=4 trim1-rep(NA,asim) trim2-rep(NA,asim) trim3-rep(NA,asim) trim4-rep(NA,asim) pw-rep(NA,asim) qw-rep(NA,asim) px-rep(NA,asim)

[R] need help to find type I error rate for modified F statistic

2012-05-29 Thread umai88
Hello everyone, I want to calculate type I error rate for modified F statistic for one way robust anova. I need to find the j group trimmed mean and winsorized sum of squared deviations. Here I attached my code for j=2 to make it simple. Originally I have j=4. Hope you can help. I need to run it

[R] Use variable inside Function for updating the matrix

2012-05-29 Thread Rantony
Hi, Here i have a data frame like this, frame name is dat *NAME AGE ELIGIBLE* A 20 B 14 C 35 D 10 E 50 In this, i want to change the column '*ELIGIBLE*' status to

[R] R quantreg - symmetry test - bootstrap SE

2012-05-29 Thread stefan23
He folks, I want to use quantile regression for doing a test of symmetrie of a distribution. Following Buchinsky I want to test, whether the square of \tau = \beta(p)+\beta(1-p)-2*\beta(0.5) (\beta(\tau) is the estimated slope parameter for quantile \tau).Unfortunately I do not know how to

Re: [R] Use variable inside Function for updating the matrix

2012-05-29 Thread Uwe Ligges
On 29.05.2012 09:17, Rantony wrote: Hi, Here i have a data frame like this, frame name is dat *NAME AGE ELIGIBLE* A 20 B 14 C 35 D 10 E 50 In this, i want to change the column

[R] correlation matrix only if enough non-NA values

2012-05-29 Thread jeff6868
Hi everybody. I'm trying to do a correlation matrix in a list of files. Each file contains 2 columns: capt1 and capt2. For the example, I merged all in one data.frame. My data also contains many missing data. The aim is to do a correlation matrix for the same data for course (one correlation

[R] GAM interactions, by example

2012-05-29 Thread Mabille, Geraldine
Dear all, I'm using the mgcv library by Simon Wood to fit gam models with interactions and I have been reading (and running) the factor 'by' variable example given on the gam.models help page (see below, output from the two first models b, and b1). The example explains that both b and b1 fits

[R] auto.arima problem

2012-05-29 Thread Actuarial_Labor
Dear all, I would like to ask how my data set contains problems. Here is what I have done. SandP = read.csv(Price.csv) library(forecast) auto.arima(SandP) and R shewed this to me Error in model.frame.default(formula = x ~ 1, drop.unused.levels = TRUE) : invalid type (list) for

[R] poLCA : Is maximum number of variables limited?

2012-05-29 Thread KDT
Dear R-users, I keep getting an ERROR saying *Error in model.matrix.default(formula, mframe) : model frame and formula mismatch in model.matrix()* when i fit poLCA with more than 63 variables. Below are the details. I am trying to do a Latent Class Analysis using poLCA. My data set contains

[R] mlogit package inquiry

2012-05-29 Thread Wong Hang
Dear all,   I am implementing a stochastic utility model that will eventually make use of multinomial logit. I found that there is a package in R called mlogit. I am not sure whether I have already found the correct package or software. May I ask am I correct?   Basically, let's say   I have

Re: [R] Hash Table - Select and Change Data iniside Matrix

2012-05-29 Thread Rantony
Hi Michel, In this function, I want to apply “OR” operator instead of “” Condition. dat[dat$AGE=40 da$AGE=30,TRUE/FALSE]-TRUE How it is possible ? - Thanks Antony From: Michael Weylandt [via R] [mailto:ml-node+s789695n4631610...@n4.nabble.com]

[R] package tm: reading XML files

2012-05-29 Thread Ad Feelders
Dear fellow R users, I'm using the package tm for text mining, and have a problem with reading in a corpus from XML files. When I copy the example from Introduction to the tm package of the small reuters subset crude, everything goes well, and I get a corpus with the required meta data. When

Re: [R] Use variable inside Function for updating the matrix

2012-05-29 Thread Rantony
Hi Uwe, How can we give OR Operator instead of AND here. dat[, tmpCol] - ifelse(dat$AGE=35 da$AGE18, YES, ) I want change this to OR dat[, tmpCol] - ifelse(dat$AGE=35 OR da$AGE18, YES, ) OR - How it is possible ? From: Uwe Ligges-3 [via R]

Re: [R] R quantreg - symmetry test - bootstrap SE

2012-05-29 Thread Liviu Andronic
On Tue, May 29, 2012 at 8:30 AM, stefan23 stefan.vo...@uni-konstanz.de wrote: He folks, I want to use quantile regression for doing a test of symmetrie of a distribution. Following Buchinsky I want to test, whether the square of \tau = \beta(p)+\beta(1-p)-2*\beta(0.5) (\beta(\tau) is the

Re: [R] need help to find type I error rate for modified F statistic

2012-05-29 Thread Rui Barradas
Hello, Without trying it, I very much doubt that your code runs: First you use 'asim' and create it after. So I've moved asim - 1000 up some lines. And it still doesn't work. 1. Run your own code before posting it. 2. Learn to use indentation. 3. Learn to use spaces to make your code easier

Re: [R] auto.arima problem

2012-05-29 Thread Prof Brian Ripley
On 29/05/2012 09:44, Actuarial_Labor wrote: Dear all, I would like to ask how my data set contains problems. Here is what I have done. SandP = read.csv(Price.csv) library(forecast) auto.arima(SandP) That's a data frame, not (from the help): x: a univariate time series

Re: [R] Relist strings? [Was: How to remove square brackets, etc. from address strings?]

2012-05-29 Thread Sabina Arndt
Hello r-help members, thank you very much for your reply, Rui Barradas. Your data file has more than one line. Yes, each line is a new record and I read several such data files into one data.frame. I've called it sabrina.txt and then processed with: x - readLines(sabrina.txt) s -

Re: [R] setting parameters equal in lm

2012-05-29 Thread Rui Barradas
Hello, Your model is equivalent of y = b1(X1 + X3) + b2X2 (plus error) So, use I() to add X1 and X3. You don't need to create an extra variable X13 - X1 + X3. See the help page for it. The point on function formula. ?I linMod2 = lm(Y ~ -1 + I(X1 + X3) + X2, data=data.set)

[R] Release plans: R-2.15.1 on June 22

2012-05-29 Thread Peter Dalgaard
Just a note, mainly to people who maintain larger R installations, that we intend to have a patch release version on June 22. The nickname will be Roasted Marshmallows. This is somewhat later than previous .1 releases, but we are also now aiming for an annual rather than biannual release

Re: [R] Relist strings? [Was: How to remove square brackets, etc. from address strings?]

2012-05-29 Thread Rui Barradas
Hello, The error message means that 'x' is not a character vector. Can't you try it only with the text in the link you've posted, http://pastebin.com/mYZNDXg6 ? I'm asking this because I've just checked it and it doesn't give any eror. Em 29-05-2012 12:39, Sabina Arndt escreveu: Hello

Re: [R] Matrix Header Name Select

2012-05-29 Thread Özgür Asar
Hi, You can try: colnames(mymatrix)-NULL Best Ozgur - Ozgur ASAR Research Assistant Middle East Technical University Department of Statistics 06531, Ankara Turkey Ph: 90-312-2105309 http://www.stat.metu.edu.tr/people/assistants/ozgur/ -- View this

Re: [R] Matrix Header Name Select

2012-05-29 Thread Özgür Asar
Sorry, I misunderstood your question. colnames(mymatrix) would select column names of your matrix. Best ozgur - Ozgur ASAR Research Assistant Middle East Technical University Department of Statistics 06531, Ankara Turkey Ph: 90-312-2105309

Re: [R] setting parameters equal in lm

2012-05-29 Thread Dustin Fife
That did it. Thanks! One more follow-up questions. How do I set a parameter to a particular value? I tried I(.5*X2), but that didn't do what I expected. On Tue, May 29, 2012 at 6:39 AM, Rui Barradas ruipbarra...@sapo.pt wrote: Hello, Your model is equivalent of y = b1(X1 + X3) + b2X2

Re: [R] setting parameters equal in lm

2012-05-29 Thread Rui Barradas
Simple, just make y2 - y - 0.5*X2 Rui Barradas Em 29-05-2012 13:55, Dustin Fife escreveu: That did it. Thanks! One more follow-up questions. How do I set a parameter to a particular value? I tried I(.5*X2), but that didn't do what I expected. On Tue, May 29, 2012 at 6:39 AM, Rui

Re: [R] setting parameters equal in lm

2012-05-29 Thread ONKELINX, Thierry
offset() fixes the parameter to 1. So offset(I(.5*X2)) should do the trick. ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie Kwaliteitszorg / team Biometrics Quality Assurance Kliniekstraat 25 1070 Anderlecht Belgium + 32 2

Re: [R] correlation matrix only if enough non-NA values

2012-05-29 Thread Rui Barradas
Hello, Instead of 'sum' use 'mean' ok - apply(tbl, 2, function(x) mean(!is.na(x)) = 0.5) cor(tbl[, ok], use=pairwise.complete.obs) Hope this helps, Rui Barradas Em 29-05-2012 10:03, jeff6868 escreveu: Hi everybody. I'm trying to do a correlation matrix in a list of files. Each file

Re: [R] setting parameters equal in lm

2012-05-29 Thread Dustin Fife
Great. Thank you! On Tue, May 29, 2012 at 8:11 AM, ONKELINX, Thierry thierry.onkel...@inbo.be wrote: offset() fixes the parameter to 1. So offset(I(.5*X2)) should do the trick. ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team

Re: [R] Hash Table - Select and Change Data iniside Matrix

2012-05-29 Thread R. Michael Weylandt
It would behoove you to read some introductory materials -- use help.start() to get be provided with the standard An Introduction to R. More generally, the help system can be accessed by typing help(name) or, as a shortcut, ?name. In your case, help() would lead to the correct answer. The OR

[R] lme: Testing within-group coefficients

2012-05-29 Thread Dan Bebber
I need to determine whether a variable y2e increases with a covariate xt within individuals, where individuals a-j are measured several times. Is it possible to test whether within-group coefficients are significantly different from zero? The coefficients from an lmList fitted to my data give:

Re: [R] Relist strings? [Was: How to remove square brackets, etc. from address strings?]

2012-05-29 Thread Sabina Arndt
Hello, thank you very much for your reply, Rui Barradas. OK, I did what you said: x - readLines(sabina.txt) s - strsplit(x, ;[[:space:]]\\[) r - lapply(s, function(x) sapply(strsplit(x, [[:blank:]]), tail, 1)) length(r) [1] 20 I don't know why your result here was 21 since the file

[R] trouble automating formula edits when log or * are present; update trouble

2012-05-29 Thread Paul Johnson
Greetings I want to take a fitted regression and replace all uses of a variable in a formula. For example, I'd like to take m1 - lm(y ~ x1, data=dat) and replace x1 with something else, say x1c, so the formula would become m1 - lm(y ~ x1c, data=dat) I have working code to finish that part of

[R] Creating a new R mirror in Chile

2012-05-29 Thread Jose Bustos Melo
Hello everyone, I would like to create a new R mirror en Chile and I would be very placed if any of you who are familiar doing it can help us. We are looking for manuals and materials need it. Thank you in advance, José Bustos Data Scientist at www.aespro.cl [[alternative HTML version

[R] strucchange Fstats() example

2012-05-29 Thread Mabille, Geraldine
Dear all, I'm trying to understand how the strucchange package is working and I have been looking at the examples given for the Fstats() function. The first example (Nile), shows one peak in the F-stats and one breakpoint is estimated, that can be plotted using the following code ## Nile data

[R] Help needed in wavelet transforming

2012-05-29 Thread tarun trivedi
Hello I am currently working on forecasting hourly electricity prices where I am required to do wavelet transformation. First I need to calculate decomposition coefficients of the wavelet transform, then I need to select wavelet function using multiresolution technique. I would be really grateful

[R] Matrix Header Name Select

2012-05-29 Thread Rantony
Hi, i have a matrix with headers. How can i get header name in that marix ? i tried in R, with names(MyMatrix[1]) - its getting exactly. But when i try in eclips, its not receiving ColHdr - names(MyMatrix[1]) - it getting NULL value - could you please help me ? - Thanks Antony. -- View this

[R] Error ! Subscript out of bounds

2012-05-29 Thread Rantony
Hi, i have a function like this, *GetCsv[GetCsv[,ColHdr]ArrMinMax[iCol,1] | GetCsv[,ColHdr]ArrMinMax[iCol,2],ColHdr_QF]-RC* Here, *GetCsv* -- It contain a matrix *ColHdr* -- Is a column Header *ArrMinMax* - It is a array of 2 columns -

[R] model frame and formula mismatch with latent class analysis poLCA

2012-05-29 Thread KDT
Dear R-users, I keep getting an ERROR saying Error in model.matrix.default(formula, mframe) : model frame and formula mismatch in model.matrix() when i fit poLCA with more than 63 variables. Below are the details. I am trying to do a Latent Class Analysis using poLCA. My data set contains

Re: [R] Matrix Header Name Select

2012-05-29 Thread Rantony
ITS OK. And thanks. Its working ! From: Özgür Asar [via R] [mailto:ml-node+s789695n4631684...@n4.nabble.com] Sent: Tuesday, May 29, 2012 6:04 PM To: Akkara, Antony (GE Energy, Non-GE) Subject: Re: Matrix Header Name Select Sorry, I misunderstood your question. colnames(mymatrix)

[R] Package for partially ordered sets

2012-05-29 Thread Christian Kampichler
Dear all, is anyone aware of an R package for handling posets, drawing Hasse diagrams etc.? I browsed through CRAN but was not successful... Thanks in advance, Christian -- Christian Kampichler Roghorst 91 6708 KD Wageningen, Niederlande Tel +31 (0)317 417527 Mob

[R] Help needed in wavelet transformation

2012-05-29 Thread tarun trivedi
Hello I am currently working on forecasting hourly electricity prices where I am required to do wavelet transformation. First I need to calculate decomposition coefficients of the wavelet transform, then I need to select wavelet function using multiresolution technique. I would be really grateful

[R] Question about random Forest function in R

2012-05-29 Thread Kelly Cool
Hello,  I am trying to run the random Forest function on a data.frame using the following code.. myrf - randomForest (y=sample_data_metal, x=Train, importance=TRUE, proximity=TRUE) However, an error occurs saying, can not handle categorical predictors with more than 32 categories.  My

[R] GLMMPQL spatial autocorrelation

2012-05-29 Thread Alexroyan
Dear all, I am experiencing problems using the glmmPQL function in the MASS package (Venables Ripley 2002) to model binomial data with spatial autocorrelation. My question - is the presence of birds affected by various hydrological parameters? Presence/absence data were collected from 83

[R] Boxplot superscript y-axis

2012-05-29 Thread eduardo van den Berg
Dear list, I need to include in a superscript number (-1) in a y-axis label of a boxplot graphic. I tried the following line: boxplot(five$gr13~five$Code, xlab=Species code, ylab=substitute(paste(DGL growth (cm.yr^{-1}, It returns the following error message: Error in DGL growth (cm.yr^{ :

[R] Create and Change Column in a Matrix as per condition

2012-05-29 Thread Rantony
Hi, i have a matrix like this *DWATT * 10 20 30 30 32 Here i need to create a new column named *DWATT_QF* with filling value as per the following condition, if DWATT_QF = RC When DWATT value less than 30

[R] RODBC, Excel, and data truncation when writing

2012-05-29 Thread Steven Lacey
Hi, I am hoping to use the RODBC package to write a dataframe to an Excel .xlsx file. The dataframe contains at least one field with character elements that exceed 255 bytes, which appears to be the cell width limit in Excel. Below is example code and the warning message received:

[R] problem with Rcmdr

2012-05-29 Thread mabel alsina harris
Hi!! My question is related to Rcmdr. I have Mac OS and I use R since more or less 1 year, not as an expert but I really like it. Now I want to install the Rcmdr package, I already downloaded it, but when I want to charged R tell me that it needed the tcltk package, so I downloaded it too

[R] poLCA package inquiry

2012-05-29 Thread KDT
Dear R-users! I am using the poLCA package to find latent classes in a dataset with binary outcomes. Several hundreds of persons can engage hundreds of items. Assume 100 items being engaged by 500 persons, the resulting dataframe is as shown below (5 persons). item1 item2 item3 item4 item5 .

Re: [R] Use variable inside Function for updating the matrix

2012-05-29 Thread arun
Hi Antony, Try this, Obj_Name-da$AGE Obj_Name [1] 20 30 40 30 25  da[Obj_Name=30 Obj_Name=40, TRUE/FALSE]-TRUE colnames(da)-c(NAME,Obj_Name,PLACE,ELIGIBLE) da   NAME Obj_Name PLACE ELIGIBLE 1  ABC   20 INDIA   NA 2  XYZ   30    FRANCE TRUE 3  PQR   40   USA   

[R] odfWeave fails to load

2012-05-29 Thread stephenb
R version 2.15.0 (2012-03-30) Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i386-pc-mingw32/i386 (32-bit) package ‘survey’ successfully unpacked and MD5 sums checked package ‘odfWeave.survey’ successfully unpacked and MD5 sums checked

[R] problems with xlim in plot.zoo() and window()

2012-05-29 Thread Agustin Lobo
I'm trying to get a minimally intuitive way of plotting zoo objects extracted for given periods of time I do: plot(alyL32007z$NEE_st,col=cod,type=b,pch=18,xlim=time(alyL32007z)[c(3000,15000)]) and get a correct plot but the expression for xlim is hard to read by humans. I try

Re: [R] problem with Rcmdr

2012-05-29 Thread Richard M. Heiberger
Please See John Fox's notes http://socserv.socsci.mcmaster.ca/jfox/Misc/Rcmdr/installation-notes.html and perhaps other parts of his website. On Tue, May 29, 2012 at 10:06 AM, mabel alsina harris biom...@hotmail.comwrote: Hi!! My question is related to Rcmdr. I have Mac OS and I use R since

Re: [R] Relist strings? [Was: How to remove square brackets, etc. from address strings?]

2012-05-29 Thread Rui Barradas
Hello, again. See comments inline Em 29-05-2012 16:28, Sabina Arndt escreveu: Hello, thank you very much for your reply, Rui Barradas. OK, I did what you said: x- readLines(sabina.txt) s- strsplit(x, ;[[:space:]]\\[) r- lapply(s, function(x) sapply(strsplit(x, [[:blank:]]), tail, 1))

Re: [R] trouble automating formula edits when log or * are present; update trouble

2012-05-29 Thread R. Michael Weylandt
Hi Paul, I haven't quite thought through this yet, but might it not be easier to convert your formula to a character and then use gsub et al on it directly? Something like this # Using m2 as you set up below m2 - lm(y ~ log(x1) + x2*x3, data=dat) f2 - formula(m2) as.formula(paste(f2[2],

Re: [R] Help needed in wavelet transformation

2012-05-29 Thread Jeff Newmiller
RSiteSearch(wavelet) at the R command line prompt, or http://rseek.org --- Jeff NewmillerThe . . Go Live... DCN:jdnew...@dcn.davis.ca.usBasics: ##.#. ##.#. Live Go...

Re: [R] how to check given number seq. is time series or not?

2012-05-29 Thread Robert Baer
Perhaps ?str is the command you seek? -Original Message- From: sagarnikam123 Sent: Saturday, May 26, 2012 10:24 PM To: r-help@r-project.org Subject: Re: [R] how to check given number seq. is time series or not? Yes,sir index of above/below numbers is time (both dataset are same)

Re: [R] trouble automating formula edits when log or * are present; update trouble

2012-05-29 Thread Bert Gunter
Michael: m2 is a model fit, not a formula. So I don't think what you suggested will work. However, I think your idea is a good one. The trick is to protect the model specification from evaluation via quote(). e.g. z - deparse(quote(lm(y~x1))) z [1] lm(y ~ x1) Then you can apply your

Re: [R] Creating a new R mirror in Chile

2012-05-29 Thread Uwe Ligges
See http://cran.r-project.org/mirror-howto.html Uwe Ligges On 29.05.2012 18:08, Jose Bustos Melo wrote: Hello everyone, I would like to create a new R mirror en Chile and I would be very placed if any of you who are familiar doing it can help us. We are looking for manuals and materials need

Re: [R] problems with xlim in plot.zoo() and window()

2012-05-29 Thread Gabor Grothendieck
On Tue, May 29, 2012 at 11:47 AM, Agustin Lobo agustin.l...@ictja.csic.es wrote: I'm trying to get a minimally intuitive way of plotting zoo objects extracted for given periods of time I do: plot(alyL32007z$NEE_st,col=cod,type=b,pch=18,xlim=time(alyL32007z)[c(3000,15000)]) and get a  

Re: [R] trouble automating formula edits when log or * are present; update trouble

2012-05-29 Thread Bert Gunter
I should have added: If the formula is just assigned to a name, quote() and eval(parse(...)) are not needed: fm1 - y ~ x1 ## a formula w - gsub( x1,log(x1), deparse(fm1)) fm2 - formula(w) This is probably the btter way to do it. -- Bert On Tue, May 29, 2012 at 10:01 AM, Bert Gunter

Re: [R] trouble automating formula edits when log or * are present; update trouble

2012-05-29 Thread Gabor Grothendieck
On Tue, May 29, 2012 at 11:43 AM, Paul Johnson pauljoh...@gmail.com wrote: Greetings I want to take a fitted regression and replace all uses of a variable in a formula. For example, I'd like to take m1 - lm(y ~ x1, data=dat) and replace x1 with something else, say x1c, so the formula would

Re: [R] trouble automating formula edits when log or * are present; update trouble

2012-05-29 Thread Paul Johnson
Try substitute: do.call(substitute, list(newFmla, setNames(list(as.name(x1c)), x1))) y ~ log(x1c) + x2 * x3 Damn. That's pretty. I'd say setNames a magic bullet too. Thanks very much. The approach suggested by Michael and Bert has the little shortcoming that grepping for x1 also picks up

Re: [R] problems with xlim in plot.zoo() and window()

2012-05-29 Thread Gabor Grothendieck
On Tue, May 29, 2012 at 1:39 PM, Agustin Lobo agustin.l...@ictja.csic.es wrote: Thanks! Using as.POSIXct() instead of as.Date() solves the problem: plot(alyL32007z$NEE_st,col=cod,type=b,pch=18,xlim=as.POSIXct(c(2007-03-04 11:30:00 UTC ,2007-11-09 11:30:00 UTC))) #works fine delme -

Re: [R] trouble automating formula edits when log or * are present; update trouble

2012-05-29 Thread R. Michael Weylandt
Deparse... that's it -- was disappointed with having to turn as.character.formula inside out once and again. Merci! But, as always, we all loose to Gabor ;-) Michael On Tue, May 29, 2012 at 1:16 PM, Bert Gunter gunter.ber...@gene.com wrote: I should have added: If the formula is just

Re: [R] importing multiple file form folder

2012-05-29 Thread mpavlic
Hi Sarah, I can not for the life of me understand what was wrong with my post?!? Can you please explain, so that i will not make the same mistake again? Regards, m -- View this message in context: http://r.789695.n4.nabble.com/importing-multiple-file-form-folder-tp4631637p4631734.html Sent

Re: [R] importing multiple file form folder

2012-05-29 Thread mpavlic
Hi Rui, Thanks a lot, it works like I wanted. I am sorry about my late response though... Is it possible to get the name of the file (Channe 1. ) as a name of the column in the resulting table (dataframe)? Many thanks, m -- View this message in context:

[R] lattice: add a marginal histogram on top of the colorkey of a levelplot?

2012-05-29 Thread Andy Bunn
Lattice experts: Can you think of a way to produce a levelplot as below and then add a histogram of the z variable to the top margin of the plot that would sit on top of the color key? x - seq(pi/4, 5 * pi, length.out = 100) y - seq(pi/4, 5 * pi, length.out = 100) r -

Re: [R] importing multiple file form folder

2012-05-29 Thread mpavlic
Hi again Rui, i got the column names settled like this : colnames(Temp) - paste(flist, seq_len(ncol(Temp)), sep=.) Thanks again, m -- View this message in context: http://r.789695.n4.nabble.com/importing-multiple-file-form-folder-tp4631637p4631737.html Sent from the R help mailing list

Re: [R] trouble automating formula edits when log or * are present; update trouble

2012-05-29 Thread Bert Gunter
Paul et. al: I think Gabor's incantation qualifies as my desired alternative to eval(parse())). It is, unfortunately, rather tricky, imo. However, the objection you raise to the gsub(deparse()) solution is easily overcome through the use of an appopriate regex: e.g.: gsub(\\x\\,log(x),x+xc+cx)

Re: [R] package tm: reading XML files

2012-05-29 Thread Milan Bouchet-Valat
Le mardi 29 mai 2012 à 10:03 +0200, Ad Feelders a écrit : Dear fellow R users, I'm using the package tm for text mining, and have a problem with reading in a corpus from XML files. When I copy the example from Introduction to the tm package of the small reuters subset crude, everything

[R] Extract time from irregular date and time data records

2012-05-29 Thread Sam Albers
Hello, I am having a problem making use of some data outputted from an instrument in a somewhat weird format. The instrument outputs two columns - one called JulianDay.Hour and one called Minutes.Seconds. I would like to convert these columns into a single column with a time. So I was using

Re: [R] problems with xlim in plot.zoo() and window()

2012-05-29 Thread Agustin Lobo
Thanks! Using as.POSIXct() instead of as.Date() solves the problem: plot(alyL32007z$NEE_st,col=cod,type=b,pch=18,xlim=as.POSIXct(c(2007-03-04 11:30:00 UTC ,2007-11-09 11:30:00 UTC))) #works fine delme - window(alyL32007z, start =

[R] Memory Windows

2012-05-29 Thread Emiliano Zapata
This is my current version of R: R version 2.15.0 (2012-03-30) Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: x86_64-pc-mingw32/x64 (64-bit) OS: Windows I get the following: memory.size() [1] 23.04 memory.limit() [1] 190600 I also have the

[R] Wilcoxon-Mann-Whitney U value: outcomes from different stat packages

2012-05-29 Thread maxbre
Given this example #start code a-c(0,70,50,100,70,650,1300,6900,1780,4930,1120,700,190,940, 760,100,300,36270,5610,249680,1760,4040,164890,17230,75140,1870,22380,5890,2430) b-c(0,0,10,30,50,440,1000,140,70,90,60,60,20,90,180,30,90, 3220,490,20790,290,740,5350,940,3910,0,640,850,260)

Re: [R] Boxplot superscript y-axis

2012-05-29 Thread Carlos Rivera
Dear Prof. Eduardo, Try this: rot-expression(paste(DGL growth (cm.yr^-1,))) boxplot(five$gr13~five$Code, xlab=Species code, ylab=rot) In this page there are some useful mathematical annotations in R: http://stat.ethz.ch/R-manual/R-patched/library/grDevices/html/plotmath.html Best wishes,

Re: [R] trouble automating formula edits when log or * are present; update trouble

2012-05-29 Thread cberry
Paul Johnson pauljoh...@gmail.com writes: Greetings I want to take a fitted regression and replace all uses of a variable in a formula. For example, I'd like to take m1 - lm(y ~ x1, data=dat) and replace x1 with something else, say x1c, so the formula would become m1 - lm(y ~ x1c,

Re: [R] Extract time from irregular date and time data records

2012-05-29 Thread Sam Albers
Apologies. I was searching using the wrong search terms. This is clearly a string issue. I've added the solution below. Sam On Tue, May 29, 2012 at 11:39 AM, Sam Albers tonightstheni...@gmail.com wrote: Hello, I am having a problem making use of some data outputted from an instrument in a

Re: [R] lattice: add a marginal histogram on top of the colorkey of a levelplot?

2012-05-29 Thread ilai
?plot.trellis. In general something like mlp- levelplot(... mhist- histogram(... plot(mlp,split=c(1,2,1,2),more=T) plot(mhist,split=c(1,1,1,2),more=F) You will need to do some work on the padding and layout widths to get the distances right (I assume the key is to be the x-axis of the

[R] Converting to XTS loses data.frame structure

2012-05-29 Thread Noah Silverman
Hello, I noticed something odd when working with data frames and xts objects. If I read in a CSV file, R creates a nice data.frame. This works well. If I then convert to an XTS object, I see that all the values in the data are now quoted. My data is a mix of numeric and character. This is

Re: [R] Converting to XTS loses data.frame structure

2012-05-29 Thread Joshua Ulrich
On Tue, May 29, 2012 at 2:11 PM, Noah Silverman noahsilver...@ucla.edu wrote: Hello, I noticed something odd when working with data frames and xts objects. If I read in a CSV file, R creates a nice data.frame.  This works well. If I then convert to an XTS object, I see that all the values

Re: [R] Question about random Forest function in R

2012-05-29 Thread Liaw, Andy
Hi Kelly, The function has a limitation that it cannot handle any column in your x that is a categorical variable with more than 32 categories. One possibility is to see if you can bin some of the categories into one to get below 32 categories. Andy -Original Message- From:

Re: [R] Converting to XTS loses data.frame structure

2012-05-29 Thread Jeff Newmiller
Only convert numeric columns to time series. This is a fundamental limitation of ts, xts, and zoo. --- Jeff NewmillerThe . . Go Live... DCN:jdnew...@dcn.davis.ca.usBasics:

Re: [R] importing multiple file form folder

2012-05-29 Thread mpavlic
Just one more thing ... my colnames are as follows : c(channel 1 20120509 153744 1.ddf, channel 1 20120509 154744 1.ddf, channel 1 20120509 155744 1.ddf, channel 1 20120509 160744 1.ddf, channel 1 20120509 161744 1.ddf, channel 1 20120509 162744 1.ddf,...) How would i

Re: [R] Question about random Forest function in R

2012-05-29 Thread Liu, Weifeng Aaron
This is a well-known limitation. You have to group categorical attributes together to work around. -- Weifeng (aaron) liu  |  retail systems pricing  |  sr research scientist -Original Message- From:

[R] Fw: Help needed in wavelet transforming

2012-05-29 Thread arun
- Forwarded Message - From: arun smartpink...@yahoo.com To: tarun trivedi taruntrivedi.iit...@gmail.com Cc: Sent: Tuesday, May 29, 2012 12:24 PM Subject: Re: [R] Help needed in wavelet transforming Hi Tarun, Have you looked into LS2w?

Re: [R] Create and Change Column in a Matrix as per condition

2012-05-29 Thread arun
Hi Antony, Try this, I changed matrix to data frame to make it work and change it back again to matrix.  There might be a easy way to do this.  GetCsv-as.matrix(data.frame(DWATT=c(10,20,30,30,32)))  GetCsv-data.frame(GetCsv)  GetCsv[GetCsv$DWATT30 | GetCsv$DWATT 31, DWAT_QF] -RC  

[R] offset glm.nb issues why so unstable?

2012-05-29 Thread D_Tomas
Hi, I am using the glm.nb model type to fit some count data with TWO offset variables. I have successfully used this approach to build scores of models for several datasets but I am having problems with two in particular. Depending on the model I try to fit for a given dataset, I obtain

[R] Factor problem

2012-05-29 Thread Raúl Bajo
HI! I am working with a table with quantitative and qualitative data; one of the columns is Level of education, which is an ordered factor. I want to get rid of the ordered factor, and set my own scale. How to do that? All the time I get the following error: In `[-.factor`(`*tmp*`, educa = Less

[R] PROBLEMS with In `[-.factor`(`*tmp*`, (¿ORDERED FACTOR?)

2012-05-29 Thread RBB
HI!!! I have a table containing qualitative and quantitative data; one of the columns contains Level of education, and the possibilities are none, High school, college; I want to give the value 0 to none, the value 1 to High school, and 2 to college, but I got the following error: In

[R] gslider-gwidgets

2012-05-29 Thread karthicklakshman
Hello R lovers, For my GUI, I am using gslider of Gwidgets. I need to add the to= value dynamically ie., maximum value from a data frame column(something like to=max(df[,3])). But I am getting error message like Error in checkPtrType(object, GtkWidget) : object of class NULL isn't a

Re: [R] trouble automating formula edits when log or * are present; update trouble

2012-05-29 Thread Bert Gunter
or use quote()... -- Bert On Tue, May 29, 2012 at 10:48 AM, cbe...@tajo.ucsd.edu wrote: Paul Johnson pauljoh...@gmail.com writes: do.call( substitute, list( frm, list( x = as.name(z) ) ) ) ## or using quote() do.call( substitute, list( frm, list( x = quote(z y ~ log(z) * (w + u)

Re: [R] Converting to XTS loses data.frame structure

2012-05-29 Thread Noah Silverman
Thanks Joshua, Appreciate it! -- Noah Silverman UCLA Department of Statistics 8208 Math Sciences Building Los Angeles, CA 90095 On May 29, 2012, at 12:17 PM, Joshua Ulrich wrote: On Tue, May 29, 2012 at 2:11 PM, Noah Silverman noahsilver...@ucla.edu wrote: Hello, I noticed something odd

Re: [R] PROBLEMS with In `[-.factor`(`*tmp*`, (¿ORDERED FACTOR?)

2012-05-29 Thread R. Michael Weylandt
Read this: http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example Read the posting guide: http://www.R-project.org/posting-guide.html and try again. It's entirely impossible to help you as is. Michael On Tue, May 29, 2012 at 2:01 PM, RBB raulba...@gmail.com

Re: [R] Relist strings? [Was: How to remove square brackets, etc. from address strings?]

2012-05-29 Thread Sabina Arndt
Hello, thank you very much for your reply, Rui Barradas. In my workspace everything was converted either to non-empty strings or NULLs. This is how to do it. r1 - lapply(r, function(x) x[nchar(x) 0]) r1 - lapply(r1, function(x) if(length(x)) x else NULL) # second pass country.list

Re: [R] Factor problem

2012-05-29 Thread R. Michael Weylandt
Please don't double post. (And see my reply to your other thread) Michael On Tue, May 29, 2012 at 1:50 PM, Raúl Bajo raulba...@gmail.com wrote: HI! I am working with a table with quantitative and qualitative data; one of the columns is Level of education, which is an ordered factor. I want

Re: [R] gslider-gwidgets

2012-05-29 Thread j verzani
karthicklakshman karthick.lakshman at gmail.com writes: Hello R lovers, For my GUI, I am using gslider of Gwidgets. I need to add the to= value dynamically ie., maximum value from a data frame column(something like to=max(df[,3])). But I am getting error message like You update the

Re: [R] Random Forest Classification_ForestCombination

2012-05-29 Thread Liaw, Andy
As long as you can remember that the summaries such as variable importance, OOB predictions, and OOB error rates are not applicable, I think that should be fine. Andy -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Nikita Desai

Re: [R] PROBLEMS with In `[-.factor`(`*tmp*`, (¿ORDERED FACTOR?)

2012-05-29 Thread Bert Gunter
...and On Tue, May 29, 2012 at 1:04 PM, R. Michael Weylandt michael.weyla...@gmail.com wrote: Read this: http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example Read the posting guide:  http://www.R-project.org/posting-guide.html and try again. It's entirely

Re: [R] importing multiple file form folder

2012-05-29 Thread jim holtman
Here is how to get the number: x - c(channel 1 20120509 153744 1.ddf, channel 1 20120509 154744 1.ddf, + channel 1 20120509 155744 1.ddf, channel 1 20120509 160744 1.ddf, + channel 1 20120509 161744 1.ddf, channel 1 20120509 162744 1.ddf) # get the number xNew -

[R] use xyplot to plot mean and CI by groups

2012-05-29 Thread John Smith
Dear R users, I am trying to use xyplot to draw group mean and CI. The following is the sample code. But I want: 1. Use different colors and symbols to draw individual points, CI and the lines connect group means from different time points; 2. Add jitters to x axis to allow CIs not be

Re: [R] Relist strings? [Was: How to remove square brackets, etc. from address strings?]

2012-05-29 Thread Rui Barradas
What is the result after each step? Could you use dput to post them? dput(head(r)) dput(head(r1)) # after the first lapply Copy the output of those instructions and paste them here. I'm asking this because I've tried with your dataset and it worked. Rui Barradas Em 29-05-2012 21:06, Sabina

  1   2   >