Re: [R] how to read/save .zip compressed files from R?

2010-08-04 Thread Prof Brian Ripley
On Tue, 3 Aug 2010, j.delashe...@ed.ac.uk wrote: Quoting Prof Brian Ripley rip...@stats.ox.ac.uk: See also Omegahat package Rcompression (a copy of which for Windows is on CRANextras). Thank you, I will look into that. But I would do this via unzip, modify, zip once or even 10 times,

Re: [R] how to do a IF ELSE in a matrix format

2010-08-04 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 03.08.2010 19:02:41: question again. here is part of my original code for my research question. originally I used a loop with matrix form to do the work and it works (though looks ugly). I have tried the methods mentioned in the above posts

[R] barplot and x-axis font size

2010-08-04 Thread Roslina Zakaria
Hi all, I would like to draw a side by side bar plot.  How can I adjust the the font size for the x-axis?  Furthermore, I'm not sure what to write for 'at=?'.  I tried cex.axis and cex.lab but still fail.  Here is my data and code:   t(all)    0-100 100-150  150-200 200-250 250-300

[R] question!!!!

2010-08-04 Thread leepama
I made some design matrix X(in linear regression model) I there any method to normalize X? -- View this message in context: http://r.789695.n4.nabble.com/question-tp2312938p2312938.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] Adding collumn to existing data frame

2010-08-04 Thread Jeff Newmiller
Sometimes we try to make things behave the way we think they ought to and find it surprisingly difficult. Later we discover that our original premise was flawed and we wasted our time trying to force fit our ideas to work. Since all of the i-th elements of the columns of a data table are

Re: [R] barplot and x-axis font size

2010-08-04 Thread Ivan Calandra
Hi! Your example is not really easy to copy paste. Next time, try using dput(), this would help a lot. I haven't tried, but I think that cex.axis is correct. The problem is in your call to barplot(). You have to specify xaxt=n so that the x-axis won't be plotted. You then plot it with your

[R] geoR - likfit failure

2010-08-04 Thread Mohammed Ouassou
Hi I'm using geoR package to perform linear spatial interpolation(OK). The function likfit() fails to compute REML. The error meassage is : Error in solve.default(v$varcov, xmat); How I can find out that likfit() is failed to process and retrieving the error message ? Thank you so much for

Re: [R] question!!!!

2010-08-04 Thread Michael Bedward
Hi I made some design matrix X(in linear regression model) I there any method to normalize X? You can normalize a matrix column-wise like this: # m is a matrix apply(m, 2, function(x) x / max(x) ) Or normalize row-wise like this: t(apply(m, 1, function(x) x / max(x) )) I'm sure there are

[R] How to let Rterm be vi style under windows?

2010-08-04 Thread Yue Wu
Hi list, As title, under windows, the method of ~/.inputrc won't work, is it possible to let Rterm be vi style on windows? P.S. I've sent it serveral days ago, get no response, so I send it again to check if I've failed to send it. -- Regards, Yue Wu Key Laboratory of Modern Chinese

Re: [R] does R have a command the same with Stata's loop command: ` '

2010-08-04 Thread Patrick Burns
So you *can* do it. There is a question remaining of whether you *should* do it. More R-ish is to use a list. On 04/08/2010 01:39, jim holtman wrote: ?paste ?assign On Tue, Aug 3, 2010 at 8:29 PM, Hey Skyheyskywal...@yahoo.com wrote: hey, Rers in Stata therer is a loop command ` ' which

[R] merge two data frames

2010-08-04 Thread arnaud gaboury
Dear list, here are my two data frames: av - structure(list(DESCRIPTION = c(COFFEE C Sep/10, COPPER Sep/10, CORN Dec/10, CRUDE OIL miNY Sep/10, GOLD Aug/10, HENRY HUB NATURAL GAS Sep/10, PALLADIUM Sep/10, SILVER Sep/10, SOYBEANS Nov/10, SPCL HIGH GRADE ZINC USD, SUGAR NO.11 Oct/10, WHEAT

[R] Substring of a character column

2010-08-04 Thread LogLord
Hi, I have a dataframe with a rather complicated descriptive column (V9): test3[(1:3), ] V1 V4 V5 10 1 4559 7173 17 1 58954 59871 19 1 357522 358458 V9 10 ID=NM_182905.1;Name=NM_182905;Alias=FLJ00038;Note=hypothetical protein LOC375690 17

[R] Odp: merge two data frames

2010-08-04 Thread Petr PIKAL
Hi you tried OK result - merge(zz, av, by=DESCRIPTION, all=TRUE) and as you did not specify what to do when one value is NA here is one possible solution rowSums(cbind(result$PL.x, result$PL.y), na.rm=T) Regards Petr r-help-boun...@r-project.org napsal dne 04.08.2010 11:52:00: Dear list,

Re: [R] SQLDF from Variable Matrix

2010-08-04 Thread Gabor Grothendieck
On Wed, Aug 4, 2010 at 12:29 AM, Suphajak Ngamlak supha...@phatrasecurities.com wrote: Dear all, I would like to do sample statistics, e.g. mean, median from very large dataset. This is part of commands I use routinely with several dataset so I would like to make it into function. The

[R] Modelling poisson distribution with variance structure

2010-08-04 Thread Karen Moore
I'm dealing with count data that's nested and has spatial dependence. I ran a glmm in lmer with a random factor for nestedness. Spatial dependence seems to have been accommodated by model. However I can't add a variance strcuture to this model (to accommodate heterogeneity). Is there a model that

Re: [R] Substring of a character column

2010-08-04 Thread Gabor Grothendieck
On Wed, Aug 4, 2010 at 6:00 AM, LogLord nils.sch...@web.de wrote: Hi, I have a dataframe with a rather complicated descriptive column (V9): test3[(1:3), ]     V1     V4     V5 10 1   4559   7173 17 1  58954  59871 19 1 357522 358458 V9 10

Re: [R] save-d file format forward compatibility

2010-08-04 Thread Duncan Murdoch
Godfrey van der Linden wrote: G'day, All. I've recently started writing up my dissertation and need to consider how to store the research results. I'd like to use the binary compressed save() format as it is considerably smaller than the raw data. However, will a future R be able to read it

Re: [R] geoR - likfit failure

2010-08-04 Thread Rubén Roa
Questions about geoR should be directed to R-SIG-GEO. Anyway, you should provide more info about your problem. Read the Posting Guide. Have you tried changing the model? Sometimes falling back from Matern to exponential or Gaussian allows successful convergence. HTH Rubén

[R] Finding points where two timeseries cross over

2010-08-04 Thread Blair Sutton
Hi Is there any way to find out at what points two timeseries cross over perhaps with some information on how they cross? Alternatively, I could write a loop that solves pairs of adjacent points using linear algebra but looking for a simpler way. Thanks in advance, Blair [[alternative

Re: [R] Substring of a character column

2010-08-04 Thread Alain Guillet
Hi, a - c(ID=NM_182905.1;Name=NM_182905;Alias=FLJ00038;Note=hypothetical protein + LOC375690 + ,ID=NM_001005484;Alias=OR4F5;Note=olfactory receptor%2C family 4%2C + subfamily F + ,ID=NM_001005224.1;Name=NM_001005224;Alias=OR4F3;Note=olfactory + receptor%2C family 4%2C subfamily F + )

Re: [R] save plot

2010-08-04 Thread John Kane
Yes, ?jpeg --- On Tue, 8/3/10, linda.s samrobertsm...@gmail.com wrote: From: linda.s samrobertsm...@gmail.com Subject: Re: [R] save plot To: gavin.simp...@ucl.ac.uk Cc: r-help@r-project.org Received: Tuesday, August 3, 2010, 5:36 PM [I presume you addressed this to Duncan Murdoch for a

Re: [R] Help with plots

2010-08-04 Thread Sarah Chisholm
Hi, I am trying to plot several time series plots with R, but I can't seem to get the x-axis properly formatted. What I am doing at the moment is: dates - seq(as.Date(2007/06/10, %Y/%m/%d), as.Date(2010/03/28, %Y/%m/%d), 7) par(mfrow=c(5,2)) plot(DateJonEnd1, End1Jon, main=Weekly Training at

[R] Question regarding S4 objects and reading in excel data with RODBC

2010-08-04 Thread Sander
L.S. I am trying to get data from an excel sheet using the RODBC library, quite like the example on page 34 of the 'Data manipulation with R' book written by Phil Spector. It seems very straightforward, yet I get the same error everytime I try it, with different excel sheets and trying to tweek

[R] Spliting a text

2010-08-04 Thread Megh Dal
Hi, I want to split a text to seperate numerical and non-numerical portions of that. For example suppose I have a text abc 3456 and I want to split in 2 parts like abc 3456. Is there any function to do that? Thanks, __ R-help@r-project.org mailing

Re: [R] Question regarding S4 objects and reading in excel data with RODBC

2010-08-04 Thread Duncan Murdoch
On 04/08/2010 5:38 AM, Sander wrote: L.S. I am trying to get data from an excel sheet using the RODBC library, quite like the example on page 34 of the 'Data manipulation with R' book written by Phil Spector. It seems very straightforward, yet I get the same error everytime I try it, with

Re: [R] merge two data frames

2010-08-04 Thread arnaud gaboury
TY Petr, it works. I will then replace NA by 0. 2010/8/4 Petr PIKAL petr.pi...@precheza.cz: Hi you tried OK result - merge(zz, av, by=DESCRIPTION, all=TRUE) and as you did not specify what to do when one value is NA  here is one possible solution rowSums(cbind(result$PL.x, result$PL.y),

Re: [R] Spliting a text

2010-08-04 Thread Gabor Grothendieck
On Wed, Aug 4, 2010 at 7:04 AM, Megh Dal megh700...@yahoo.com wrote: Hi, I want to split a text to seperate numerical and non-numerical portions of that. For example suppose I have a text abc 3456 and I want to split in 2 parts like abc 3456. Is there any function to do that? If the

Re: [R] Spliting a text

2010-08-04 Thread David Winsemius
On Aug 4, 2010, at 7:04 AM, Megh Dal wrote: Hi, I want to split a text to seperate numerical and non-numerical portions of that. For example suppose I have a text abc 3456 and I want to split in 2 parts like abc 3456. Is there any function to do that? ?strsplit ?regex -- David

Re: [R] Using '[' as a function

2010-08-04 Thread peter dalgaard
On Aug 3, 2010, at 7:59 PM, Johann Hibschman wrote: Duncan Murdoch murdoch.dun...@gmail.com writes: On 29/07/2010 6:18 PM, chipmaney wrote: -Why does R recognize '[' as a function? Because it is a function. More explicitly, '[' is a string. sapply then calls match.fun to look up

[R] retrieve name of an object?

2010-08-04 Thread Liviu Andronic
Dear all Is there an easier way to retrieve the name of an object? For example, tmp - 1:10 as.character(quote(tmp)) [1] tmp as.character(quote(mtcars$cyl)) [1] $ mtcars cyl as.character(quote(mtcars$cyl))[3] [1] cyl The last call more than anything seems a hack. Is there a better

[R] ggplot2 barplot: extra markers in graph

2010-08-04 Thread Dieter Vanderelst
Dear List, (self-contained example + version info at the bottom) I'm having trouble producing a barplot using the functions in ggplot2. When I use the position=dodge option, the bars are plotted but also a number of spurious markers. More specifically, a number of black dots are plotted in

Re: [R] retrieve name of an object?

2010-08-04 Thread jim holtman
I am not sure what you mean by a hack? Can you elaborate further, give details on the problem you are trying to solve. Does this work as a lesser hack: tail(as.character(quote(mtcars$cyl)),1) [1] cyl tail(as.character(quote(cyl)),1) [1] cyl On Wed, Aug 4, 2010 at 7:47 AM, Liviu Andronic

Re: [R] retrieve name of an object?

2010-08-04 Thread Henrique Dallazuanna
Tryu this: deparse(substitute(mtcars)) On Wed, Aug 4, 2010 at 8:47 AM, Liviu Andronic landronim...@gmail.comwrote: Dear all Is there an easier way to retrieve the name of an object? For example, tmp - 1:10 as.character(quote(tmp)) [1] tmp as.character(quote(mtcars$cyl)) [1] $

Re: [R] How to connect R with SAP

2010-08-04 Thread Henrique Dallazuanna
Try this: library(RDCOMClient) ## Criando a conexao com o SAP oLogonControl - COMCreate(SAP.Logoncontrol.1) ## Conectando com o usuario ao SAP g_connection - oLogonControl$NewConnection() g_connection[[System]]- PD4 g_connection[[ApplicationServer]] - server_ip

Re: [R] ggplot2 barplot: extra markers in graph

2010-08-04 Thread David Winsemius
On Aug 4, 2010, at 7:52 AM, Dieter Vanderelst wrote: Dear List, (self-contained example + version info at the bottom) I'm having trouble producing a barplot using the functions in ggplot2. When I use the position=dodge option, the bars are plotted but also a number of spurious markers.

Re: [R] save plot

2010-08-04 Thread linda.s
Can I make a group of jpeg instead of pdfs? Thanks. Linda On Wed, Aug 4, 2010 at 6:47 AM, John Kane jrkrid...@yahoo.ca wrote: Yes,  ?jpeg --- On Tue, 8/3/10, linda.s samrobertsm...@gmail.com wrote: From: linda.s samrobertsm...@gmail.com Subject: Re: [R] save plot To:

Re: [R] barplot and x-axis font size

2010-08-04 Thread Jim Lemon
On 08/04/2010 05:38 PM, Roslina Zakaria wrote: Hi all, I would like to draw a side by side bar plot. How can I adjust the the font size for the x-axis? Furthermore, I'm not sure what to write for 'at=?'. I tried cex.axis and cex.lab but still fail. Here is my data and code: t(all)

Re: [R] save plot

2010-08-04 Thread Alain Guillet
?jpeg On 04-Aug-10 14:28, linda.s wrote: Can I make a group of jpeg instead of pdfs? Thanks. Linda On Wed, Aug 4, 2010 at 6:47 AM, John Kanejrkrid...@yahoo.ca wrote: Yes, ?jpeg --- On Tue, 8/3/10, linda.ssamrobertsm...@gmail.com wrote: From: linda.ssamrobertsm...@gmail.com Subject: Re:

Re: [R] retrieve name of an object?

2010-08-04 Thread Duncan Murdoch
On 04/08/2010 7:47 AM, Liviu Andronic wrote: Dear all Is there an easier way to retrieve the name of an object? For example, tmp - 1:10 as.character(quote(tmp)) [1] tmp as.character(quote(mtcars$cyl)) [1] $ mtcars cyl as.character(quote(mtcars$cyl))[3] [1] cyl The last call more

[R] Best way to Convert String to Time for comparison?

2010-08-04 Thread allany
Hi guys, I have a large text file with a bunch of Time in HH:MM format, what would be the best way to process it into a Time Object so that I can use comparisons like (1:001:15) or (13:002:00) to both return true. Right now if I do a comparison like (3:00 1:59) I get a true, but if I do (3:00

Re: [R] Best way to Convert String to Time for comparison?

2010-08-04 Thread Gabor Grothendieck
On Wed, Aug 4, 2010 at 8:43 AM, allany all...@cmu.edu wrote: Hi guys, I have a large text file with a bunch of Time in HH:MM format, what would be the best way to process it into a Time Object so that I can use comparisons like (1:001:15) or (13:002:00) to both return true. Right now if I

Re: [R] multiple R sessions from one working directory using GNU screen

2010-08-04 Thread david.jessop
Olga There was a presentation at the London R user group about doing what you ask using the bigmemory package (http://www.londonr.org/LondonR-20090331/realtimeR.pdf). I believe you can do the same thing with ff. This wouldn't share the whole workspace but just the objects you choose. Regards

Re: [R] grep with search terms defined by a variable

2010-08-04 Thread Amos Folarin
You might also find match and pmatch of use here. On Aug 3, 2010, at 12:05 AM, Daniel Malter wrote: Hi, I have a good grasp of grep() and gsub() for finding and extracting character strings. However, I cannot figure out how to use a search term that is stored in a

[R] merge two data frames

2010-08-04 Thread Amos Folarin
Hi Arnaud, It is slightly confusing what you are asking but if you just want a dataframe with the two zz$PL and av$PL columns concatenated then merge is not what you are after. Try something like this. t - rbind(data.frame(PL=zz$PL), data.frame(PL=av$PL)) t PL 1 3075.00

Re: [R] grid.table and expression in table body?

2010-08-04 Thread baptiste Auguié
Try this, source(http://gridextra.googlecode.com/svn/trunk/inst/test/expressions.r;) library(grid) e = expression(p[Wilcoxon], *2.2%*%10^{-16}) grid.expr(e) HTH, baptiste On Aug 4, 2010, at 9:56 AM, Johannes Graumann wrote: Hi Baptiste, This is, I fear a bit beyond my level of competency

Re: [R] multiple R sessions from one working directory using GNU screen

2010-08-04 Thread Olga Lyashevska
Dear Steven, Thanks for your post. It explains a lot. The reason I wanted to use multiple sessions simultaneously is that because when I run something it usually takes quite a while (calculating distance matrices), meaning that I have to wait before R can handle the next task. Also RAM is

Re: [R] Best way to Convert String to Time for comparison?

2010-08-04 Thread Nikhil Kaza
Another way is t1- c(3:00,1:59,3:00,2:00) t2 - strptime(t1, format=%H:%M) t2[-4]t2[-1] Nikhil Kaza Asst. Professor, City and Regional Planning University of North Carolina nikhil.l...@gmail.com On Aug 4, 2010, at 8:47 AM, Gabor Grothendieck wrote: On Wed, Aug 4, 2010 at 8:43 AM, allany

Re: [R] Collinearity in Moderated Multiple Regression

2010-08-04 Thread Michael Friendly
haenl...@gmail.com wrote: I'm sorry -- I think I chose a bad example. Let me start over again: I want to estimate a moderated regression model of the following form: y = a*x1 + b*x2 + c*x1*x2 + e Based on my understanding, including an interaction term (x1*x2) into the regression in addition

Re: [R] ggplot2 barplot: extra markers in graph

2010-08-04 Thread Shentu
The reason you see the exra markers is that the first part of the command qplot(DT$N,DT$D,fill=factor(DT$C)) already plots the individual points. You didn't see it with geom_bar(stat = identity) simply because the stacked bars made the previous layer invisible. To see this you can use the ggplot

[R] help with using grid.polygon()

2010-08-04 Thread Ally
Hi, I'm trying to use grid.polygon() to plot several polygons at once, with a view to putting coloured polygons beneath a curve. I'm struggling just to get the grid.polygon to plot anything # PLOT SOME POINTS x - 1:100 y - 1:100*0.5 + 3 plot(x, y, pch = .) # PLOT 2

Re: [R] Collinearity in Moderated Multiple Regression

2010-08-04 Thread Liaw, Andy
Seems to me it may be worth stating what may be elementary to some on this list: - If all relevant variables are included in the model and the true model is indeed linear, then all least squares estimated coefficients are unbiased. [ David Ruppert once said about the three kinds of lies:

Re: [R] help with using grid.polygon()

2010-08-04 Thread David Winsemius
On Aug 4, 2010, at 9:32 AM, Ally wrote: Hi, I'm trying to use grid.polygon() to plot several polygons at once, with a view to putting coloured polygons beneath a curve. I'm struggling just to get the grid.polygon to plot anything # PLOT SOME POINTS x - 1:100 y -

Re: [R] multiple R sessions from one working directory using GNU screen

2010-08-04 Thread Olga Lyashevska
Thanks David, I looked briefly through the bigmemory package and it looks very promising. As I mentioned in my previous post to Steven I am calculating distance matrices, and if it is my bottleneck (I am nearly sure it is) I believe that the bigmemory will be particularly useful as it is designed

[R] argument is of length 0 condition has length1

2010-08-04 Thread Leigh E. Lommen
I have the following array: head(stocks) DATE TICKER PERMNO EXCHCD TSYMBOL TRDSTAT SHROUTPRC RET 1 19950131 EWST 10001 3EWST A 2224 -7.75000 -0.031250 2 19950228 EWST 10001 3EWST A 2224 7.54688 -0.026210 3 19950331 EWST 10001 3

Re: [R] ggplot2 barplot: extra markers in graph

2010-08-04 Thread Dieter Vanderelst
Thanks, this indeed solved the problem. Regards, Dieter On 4/08/2010 15:21, Shentu wrote: The reason you see the exra markers is that the first part of the command qplot(DT$N,DT$D,fill=factor(DT$C)) already plots the individual points. You didn't see it with geom_bar(stat = identity) simply

Re: [R] argument is of length 0 condition has length1

2010-08-04 Thread David Winsemius
On Aug 4, 2010, at 9:46 AM, Leigh E. Lommen wrote: I have the following array: head(stocks) DATE TICKER PERMNO EXCHCD TSYMBOL TRDSTAT SHROUTPRC RET 1 19950131 EWST 10001 3EWST A 2224 -7.75000 -0.031250 2 19950228 EWST 10001 3EWST A

Re: [R] Finding points where two timeseries cross over

2010-08-04 Thread Matthew Dowle
Is this what you mean? x=c(1,2,2,3,4,5,6,3,2,1) y=c(2,3,4,2,1,2,3,4,5,6) matplot(cbind(x,y),type=l) which(diff(sign(x-y))!=0)+1 [1] 4 8 -- View this message in context: http://r.789695.n4.nabble.com/Finding-points-where-two-timeseries-cross-over-tp2313257p2313510.html Sent from the R help

Re: [R] retrieve name of an object?

2010-08-04 Thread Liviu Andronic
Dear Duncan On Wed, 04 Aug 2010 08:33:49 -0400 Duncan Murdoch murdoch.dun...@gmail.com wrote: As other have pointed out, in a function you can use substitute(arg) to retrieve the expression passed as arg, and deparse(substitute(arg)) to turn it into a string that's suitable for using as a

Re: [R] metafor and meta-analysis at arm-level

2010-08-04 Thread Angelo Franchini
Hello Wolfgang. I'd appreciate if you could help me check whether I am doing the proper thing to do an arm-level meta-analysis with metafor and what differences there might be in trying to do the same with lme and lm. I am following the arm based model described in section 3.2 of the Salanti's

[R] discrete ECDF

2010-08-04 Thread David Winsemius
Dear list; I just created a utility function that replicates what I have done in the past with Excel or OO.org by putting a formula of the form =sum($A1:A$1) in an upper-corner of a section and then doing a fill procedure by dragging the lower-rt corner down and to the right. When

Re: [R] grid.table and expression in table body?

2010-08-04 Thread baptiste Auguié
I added a parse argument to grid.table so that when switched to TRUE (default FALSE) all the text strings are interpreted as expressions (inspired by ggplot2::geom_text), d - data.frame(alpha, beta) grid.table(d, parse=T) you'll need revision 258 of gridExtra for this to work (googlecode now,

Re: [R] argument is of length 0 condition has length1

2010-08-04 Thread Joshua Wiley
Hi Leigh, Several aspects of your email make it challenging to offer advice. We are missing part of your data (e.g., 'T' in 1:T), and it is not terribly clear what 't' in (t-5) to t(19950630) to (t+7) is supposed to mean (thought I would hazard the guess time, and that it is represented by your

Re: [R] grid.table and expression in table body?

2010-08-04 Thread Johannes Graumann
Great! I will give it a try ASAP! Thanks! Joh On Wednesday 04 August 2010 16:47:12 baptiste Auguié wrote: I added a parse argument to grid.table so that when switched to TRUE (default FALSE) all the text strings are interpreted as expressions (inspired by ggplot2::geom_text), d -

Re: [R] discrete ECDF

2010-08-04 Thread Charles C. Berry
On Wed, 4 Aug 2010, David Winsemius wrote: Dear list; I just created a utility function that replicates what I have done in the past with Excel or OO.org by putting a formula of the form =sum($A1:A$1) in an upper-corner of a section and then doing a fill procedure by dragging the lower-rt

[R] RWeka problem: java.lang.NoSuchMethodError

2010-08-04 Thread Yonghee Shin
Hi, I'm trying to use RWeka and followed the following example from the RWeka manual. ## Use some example data. w - read.arff(system.file(arff,weather.nominal.arff, package = RWeka)) ## Identify a decision tree. m - J48(play~., data = w) m ## Use 10 fold cross-validation. e -

Re: [R] discrete ECDF

2010-08-04 Thread Wu Gong
Just a little difference. ecdf.tbl - function (.dat) { .dat - as.matrix(.dat) na.m - is.na(.dat) .dat[na.m]-0 # Assign NA a value 0 res - apply(t(apply(.dat,1,cumsum)),2,cumsum) res[na.m] - NA # Assign NA back return(res) } - A R

[R] Maximum seasonal 'q' parameter

2010-08-04 Thread Shubha Vishwanath Karanth
Hi R, Seems like the maximum seasonal 'q' parameter for the ?arima is 350. Any way, where we can increase this? Since I am working on 3 year (q=252*3) and 5 year(q=252*5) returns, I may require this option. Thanks. fit=arima(r,c(3,0,0),seasonal = list(order = c(0, 0, 500), period =

Re: [R] how to change values of the object in R-lang.

2010-08-04 Thread Wu Gong
Hi, Try help($). dwt - function(ld, filter='d8', n.levels=lev, boundary=reflaction) { list(W=ld, V=n.levels,filter=filter) } dec - dwt(1:10, filter='d8', n.levels=10, boundary=reflaction) dec$W dec$V dec$filter dec$W - sqrt(1:10) dec - A R learner. -- View this message in

Re: [R] discrete ECDF

2010-08-04 Thread David Winsemius
On Aug 4, 2010, at 11:06 AM, Charles C. Berry wrote: On Wed, 4 Aug 2010, David Winsemius wrote: Dear list; I just created a utility function that replicates what I have done in the past with Excel or OO.org by putting a formula of the form =sum($A1:A$1) in an upper-corner of a section

[R] by group testing

2010-08-04 Thread cheba meier
Hello, I have a data set which is similar to the following data mice - rep(letters[1:4],10) outcome - sample(c(0,1),length(mice),replace=T) group - c(rep(A,length(mice)/2),rep(B,length(mice)/2)) my.data - data.frame(mice,outcome,group) my.sort.data - my.data[order(my.data[,1]),] I would like

Re: [R] split / lapply over multiple columns

2010-08-04 Thread Bert Gunter
In general, the lapply(split(...)) construction should never be used. Use tapply() or by() instead, along the lines of by(dataframe,with(yourdata,list(your columns)), function(...),...) If you find this complexity annoying, then look into Hadley Wickham's plyr package for simpler constructions,

[R] converting monthly to weekly without changing the original values

2010-08-04 Thread Dimitri Liakhovitski
Hello! I have a code for converting monthly values into weekly values: monthly-data.frame(month=c(20100301,20100401,20100501,20100601,20100301,20100401,20100501,20100601),monthly.value=c(100,NA,200,300,10,NA,20,30),market=c(Market A,Market A,Market A,Market A,Market B,Market B,Market B,Market B))

Re: [R] converting monthly to weekly without changing the original values

2010-08-04 Thread Dimitri Liakhovitski
Sorry, I found the solution: library(zoo) z - read.zoo(monthly, split = market) all.dates - seq(start(z), as.Date(as.yearmon(end(z)), frac = 1), by = day) ## mondays - all.dates[weekdays(all.dates) == Monday] ## weeks - na.locf(z, xout = mondays, na.rm = FALSE, maxgap=0) do.call(rbind, by(weeks,

[R] printing html help to the terminal

2010-08-04 Thread Michael Lachmann
I'm trying to get help to print the help pages in html format to the terminal. This is in order to be able to see the html help files remotely. If I do printURL = function(file) {a=readLines(url(file));cat(a,sep=\n)} options(browser=printURL) options(help_type=html) then invoking help with

Re: [R] question!!!!

2010-08-04 Thread Greg Snow
?scale -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- project.org] On Behalf Of leepama Sent: Tuesday, August 03, 2010 10:55 PM To:

Re: [R] split / lapply over multiple columns

2010-08-04 Thread Ralf B
In general, the lapply(split(...)) construction should never be used. Why? What makes it so bad to use? __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] by group testing

2010-08-04 Thread Joshua Wiley
Hello, This will put the results of the Fisher test in a list, with each element of the list being the results for mouse type a, b, c, and d. mice - rep(letters[1:4],10) outcome - sample(c(0,1),length(mice),replace=T) group - c(rep(A,length(mice)/2),rep(B,length(mice)/2)) my.data -

[R] Question regarding significance of a covariate in a coxme survival model

2010-08-04 Thread Christopher David Desjardins
Hi, I am running a Cox Mixed Effects Hazard model using the library coxme. I am trying to model time to onset (age_sym1) of thought problems (e.g. hearing voices) (sym1). As I have siblings in my dataset, I have decided to account for this by including a random effect for family (famid). My

Re: [R] does R have a command the same with Stata's loop command: ` '

2010-08-04 Thread Greg Snow
Do ?'for' to learn about for loops. Look at FAQ 7.21 for the other part of the question (the most important part of the answer is the end where it tells you to use lists instead like Patrick suggests). -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare

Re: [R] does R have a command the same with Stata's loop command: ` '

2010-08-04 Thread Gabor Grothendieck
On Wed, Aug 4, 2010 at 1:28 PM, Greg Snow greg.s...@imail.org wrote: Do ?'for' to learn about for loops. and put that in quotes since its a reserved word: ?for __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE

Re: [R] by group testing

2010-08-04 Thread Joshua Wiley
On Wed, Aug 4, 2010 at 10:17 AM, Joshua Wiley jwiley.ps...@gmail.com wrote: Hello, This will put the results of the Fisher test in a list, with each element of the list being the results for mouse type a, b, c, and d. mice - rep(letters[1:4],10) outcome -

[R] applying strsplit to a whole column

2010-08-04 Thread Dimitri Liakhovitski
I am sorry, I'd like to split my column (names) such that all the beginning of a string (X..) is gone and only the rest of the text is left. x-data.frame(names=c(X..aba,X..abb,X..abc,X..abd)) x$names-as.character(x$names) (x) str(x) Can't figure out how to apply strsplit in this situation -

Re: [R] applying strsplit to a whole column

2010-08-04 Thread Erik Iverson
Dimitri Liakhovitski wrote: I am sorry, I'd like to split my column (names) such that all the beginning of a string (X..) is gone and only the rest of the text is left. x-data.frame(names=c(X..aba,X..abb,X..abc,X..abd)) x$names-as.character(x$names) (x) str(x) Can't figure out how to apply

Re: [R] applying strsplit to a whole column

2010-08-04 Thread Tal Galili
Have a look at the stringr package It simplifies such things... Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (Hebrew) | www.r-statistics.com

Re: [R] applying strsplit to a whole column

2010-08-04 Thread Henrique Dallazuanna
Try this: gsub(X\\.\\., , x$names) On Wed, Aug 4, 2010 at 2:42 PM, Dimitri Liakhovitski dimitri.liakhovit...@gmail.com wrote: I am sorry, I'd like to split my column (names) such that all the beginning of a string (X..) is gone and only the rest of the text is left.

Re: [R] does R have a command the same with Stata's loop command: ` '

2010-08-04 Thread Gabor Grothendieck
On Wed, Aug 4, 2010 at 1:35 PM, Gabor Grothendieck ggrothendi...@gmail.com wrote: On Wed, Aug 4, 2010 at 1:28 PM, Greg Snow greg.s...@imail.org wrote: Do ?'for' to learn about for loops. and put that in quotes since its a reserved word: ?for Sorry, I missed the fact that Greg actually did

Re: [R] applying strsplit to a whole column

2010-08-04 Thread Joshua Wiley
Hi, You already have great solutions. I just wanted to point out that A) strsplit() works on the entire column automatically so you would not need a loop B) with the argument stringsAsFactors = FALSE, your character data will not be converted to factor, so you would not need to convert it back.

Re: [R] printing html help to the terminal

2010-08-04 Thread Duncan Murdoch
On 04/08/2010 12:44 PM, Michael Lachmann wrote: I'm trying to get help to print the help pages in html format to the terminal. This is in order to be able to see the html help files remotely. If I do printURL = function(file) {a=readLines(url(file));cat(a,sep=\n)} options(browser=printURL)

Re: [R] applying strsplit to a whole column

2010-08-04 Thread David Winsemius
On Aug 4, 2010, at 1:42 PM, Dimitri Liakhovitski wrote: I am sorry, I'd like to split my column (names) such that all the beginning of a string (X..) is gone and only the rest of the text is left. I could not tell whether it was the string X.. or the pattern X.. that was your goal for

Re: [R] applying strsplit to a whole column

2010-08-04 Thread Dimitri Liakhovitski
Thank you very much, everyone! Dimitri On Wed, Aug 4, 2010 at 2:10 PM, David Winsemius dwinsem...@comcast.net wrote: On Aug 4, 2010, at 1:42 PM, Dimitri Liakhovitski wrote: I am sorry, I'd like to split my column (names) such that all the beginning of a string (X..) is gone and only the rest

Re: [R] printing html help to the terminal

2010-08-04 Thread Michael Lachmann
I just tried it under OSX and linux, and both get stuck. Maybe R on windows forks the R help server? But what you suggested works perfectly. Thanks! Do you by chance know if there was something equivalent in R 2.10.x and/or 2.9.x Duncan Murdoch-2 wrote: On 04/08/2010 12:44 PM, Michael

[R] aggregate with non-scalar functions

2010-08-04 Thread David Carslaw
Hi R-users, Since R.2.11 aggregate can now deal with non-scalar functions, which is very useful to me. However, I have a question about how best to process the output. test - data.frame(a = rep(c(g1, g2), each = 50), b = runif(100)) res - aggregate(test$b, list(group = test$a), function(x)

[R] Passing the name of a variable to a function

2010-08-04 Thread Anthony Staines
Dear colleagues, I have a problem which has bitten me occasionally. I often need to prepare graphs for many variables in a data set, but seldom for all. or for any large number of sequential or sequentially named variables. Often I need several graphs for different subsets of the dataset for a

Re: [R] How to create ff objects from database connection

2010-08-04 Thread Xiaobo Gu
Hi, I am sorry for that I can’t determine which R-sig list to post questions about package ff. Now I have made a little progress with this: read.dbres.ffdf - function( res){ data1 - fetch(res, 0) if (nrow(data1) == 0){

[R] error with ReadAffy()

2010-08-04 Thread mandova
Hi!I'm doing a little data importing from .cel files, setwd(/home/mandova/celfiles) mydata-ReadAffy() Error in sub(^/?([^/]*/)*, , filenames, extended = TRUE) : unused argument(s) (extended = TRUE) Then I tried filenames-paste(GSM,c(seq(138597,138617,1)),.cel,sep=)

[R] how to values of the object in R-lang.

2010-08-04 Thread buburumka
Hello dec=dwt(ld, filter='d8', n.levels=lev, boundary=reflaction); dwt is an function which returns W, V, filter dec is an object which consist of W, V, filter and others How to change values (of W, V, filter...) when i have dec thank you! -- View this message in context:

[R] wavlet transform

2010-08-04 Thread buburumka
Hello I do wavelet transform by using this code: dec=dwt(ld, filter='d8', n.levels=lev, boundary=reflaction); dec consists of the decomposition coefficients and other How can I change the coefficients the decomposition manualy? -- View this message in context:

[R] aggregate with non-scalar functions

2010-08-04 Thread carslaw
Hi R-users, Since R.2.11 aggregate can now deal with non-scalar functions, which is very useful to me. However, I have a question about how best to process the output. test - data.frame(a = rep(c(g1, g2), each = 50), b = runif(100)) res - aggregate(test$b, list(group = test$a), function(x)

Re: [R] applying strsplit to a whole column

2010-08-04 Thread Dimitri Liakhovitski
I am sorry, someone said that strsplit automatically works on a column. How exactly does it work? For example, if I want to grab just the first (or the second) part of the string in nam1 that should be split based on .. x-data.frame(nam1=c(bbb..aba,ccc..abb,ddd..abc,eee..abd),

[R] more questions on gam/gamm(mgcv)...

2010-08-04 Thread Xia Li
Hi R-users, I'm using R 2.11.1, mgcv 1.6-2 to fit a generalized additive mixed model. I'm new to this package...and just got more and more problems... 1. Can I include correlation and/or random effect into gam( ) also? or only gamm( ) could be used? 2. I want to estimate the smoothing function

  1   2   >