[R] string handling

2010-06-03 Thread karena
I have a data.frame as the following: var1var2 9G/G09abd89C/T90 10A/T932C/C 90G/G A/A . . . . . . 10T/C 00G/G90 What I want is to get the letters which are on the left and right of '/'. for example, for "9G/G09", I only want "G", "G",

Re: [R] import text file into R

2010-06-03 Thread Bird James-R31391
You may want to try read.delim if you are having troubles with read.table. Jim -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of dhanush Sent: Thursday, June 03, 2010 4:33 AM To: r-help@r-project.org Subject: [R] import text file int

[R] Interaction versus combinations

2010-06-03 Thread Alex van der Spek
I can get the interactions between factors like this: > idx=c(1,3,6,9) > jdx=idx > levels(interaction(idx,jdx,lex.order=TRUE)) [1] "1.1" "1.3" "1.6" "1.9" "3.1" "3.3" "3.6" "3.9" "6.1" "6.3" "6.6" "6.9" [13] "9.1" "9.3" "9.6" "9.9" This list contains all possible interactions. Whereas I need

[R] sig for R and C++

2010-06-03 Thread Erin Hodgess
Dear R People: Is there a sig for people using R and C++, please? Thank you in advance, Sincerely, Erin -- Erin Hodgess Associate Professor Department of Computer and Mathematical Sciences University of Houston - Downtown mailto: erinm.hodg...@gmail.com ___

Re: [R] Interaction versus combinations

2010-06-03 Thread Marc Schwartz
On Jun 3, 2010, at 2:08 PM, Alex van der Spek wrote: > I can get the interactions between factors like this: > > > idx=c(1,3,6,9) > > jdx=idx > > levels(interaction(idx,jdx,lex.order=TRUE)) > [1] "1.1" "1.3" "1.6" "1.9" "3.1" "3.3" "3.6" "3.9" "6.1" "6.3" "6.6" "6.9" > [13] "9.1" "9.3" "9.6" "9.9

Re: [R] Interaction versus combinations

2010-06-03 Thread Jorge Ivan Velez
Hi Alex, Here is a suggestion: apply(combn(idx, 2), 2, paste, collapse = ".") See ?combn, ?apply and ?paste for more information. HTH, Jorge On Thu, Jun 3, 2010 at 3:08 PM, Alex van der Spek <> wrote: > I can get the interactions between factors like this: > > > idx=c(1,3,6,9) > > jdx=idx >

Re: [R] Interaction versus combinations

2010-06-03 Thread Phil Spector
Perhaps not the best or easiest way, but does: apply(t(combn(idx,2)),1,paste,collapse='.') [1] "1.3" "1.6" "1.9" "3.6" "3.9" "6.9" get you in the right direction? - Phil Spector Statistical Computing Facility

Re: [R] sig for R and C++

2010-06-03 Thread Marc Schwartz
On Jun 3, 2010, at 2:10 PM, Erin Hodgess wrote: > Dear R People: > > Is there a sig for people using R and C++, please? > > Thank you in advance, > Sincerely, > Erin That subject matter would tend to go to R-Devel: https://stat.ethz.ch/mailman/listinfo/r-devel The full list of "official" R

Re: [R] plot polar coordinates

2010-06-03 Thread Thomas Steiner
Thank you Greg, I'll add 180 then. Thanks for the hint with longer radial.lim arguments it works woderfull. > The lines function is plotting in Cartesian coordinates, not the polar > coordinates. Is there any (lines) function that plots polar coordinates to an existing plot? Thank you very mu

Re: [R] cumsum function with data frame

2010-06-03 Thread Felipe Carrillo
Better yet, is shorter using tranform instead of summarise: Data <- read.table(textConnection("variable    Year  value EC01    2005    5 EC01    2006    10 AAO1    2005  2 AAO1  2006  4"),header=T) ddply(Data,.(variable),transform,CUM

[R] data-management: Rowwise NA

2010-06-03 Thread moleps
Dear R´ers.. In this mock dataset how can I generate a logical variable based on whether just tes or tes3 are NA in each row?? test<-sample(c("A",NA,"B"),100,replace=T) test2<-sample(c("A",NA,"B"),100,replace=T) test3<-sample(c("A",NA,"B"),100,replace=T) tes<-cbind(test,test2,test3) sam<-c("t

Re: [R] data-management: Rowwise NA

2010-06-03 Thread Phil Spector
?any Not really a reproducible answer, but I think you're looking for apply(tes[,sam],1,function(x)any(is.na(x))) - Phil Spector Statistical Computing Facility Department o

Re: [R] cumsum function with data frame

2010-06-03 Thread Jorge Ivan Velez
Or better yet, you can use transform only (in base): transform(Data, CUMSUM = cumsum(value)) HTH, Jorge On Thu, Jun 3, 2010 at 3:30 PM, Felipe Carrillo <> wrote: > Better yet, is shorter using tranform instead of summarise: > Data <- read.table(textConnection("variableYear value >

Re: [R] sig for R and C++

2010-06-03 Thread Romain Francois
Also, in the Rcpp-devel mailing list: https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel we do talk a lot about R and C++, mainly because that is what Rcpp is all about. Le 03/06/10 21:21, Marc Schwartz a écrit : On Jun 3, 2010, at 2:10 PM, Erin Hodgess wrote: Dear R

Re: [R] split a row into multiple columns

2010-06-03 Thread jim holtman
If you want a matrix, then just create one from the data you have: mydata <- matrix(strsplit(x, '\t')[[1]], nrow=1) On Thu, Jun 3, 2010 at 1:30 PM, Kevin Burnham wrote: > Would somebody please help me break this row: > > "Main Group\t1000\tMP Test\tMP Test, 1\tAudio (1, f1-qaddara.aiff)\tl > (ta

Re: [R] string handling

2010-06-03 Thread jim holtman
try this: > x <- "1234C/Tasdf" > y <- strsplit(sub("^.*(.)/(.).*", "\\1 \\2", x),' ')[[1]] > y [1] "C" "T" > On Thu, Jun 3, 2010 at 2:18 PM, karena wrote: > > I have a data.frame as the following: > var1        var2 > 9G/G09    abd89C/T90 > 10A/T9    32C/C > 90G/G      A/A > .             . > .

Re: [R] data-management: Rowwise NA

2010-06-03 Thread Jorge Ivan Velez
Hi there, One option would be apply(tes, 1, function(.row) any(is.na(.row[c(1,3)]))) See ?any, ?is.na and ?apply for more information. HTH, Jorge On Thu, Jun 3, 2010 at 3:20 PM, moleps <> wrote: > Dear R´ers.. > > In this mock dataset how can I generate a logical variable based on whether >

Re: [R] data-management: Rowwise NA

2010-06-03 Thread Marc Schwartz
On Jun 3, 2010, at 2:20 PM, moleps wrote: > Dear R´ers.. > > In this mock dataset how can I generate a logical variable based on whether > just tes or tes3 are NA in each row?? > > test<-sample(c("A",NA,"B"),100,replace=T) > test2<-sample(c("A",NA,"B"),100,replace=T) > test3<-sample(c("A",NA,"

Re: [R] data-management: Rowwise NA

2010-06-03 Thread David S Freedman
you probably want to use the apply function: d=sample(1000,500); d[sample(500,50)]<-NA; #put 50 NAs into the data d=data.frame(matrix(d,ncol=50)); names(d)=paste('var',1:50,sep='.') d apply(d,1,sum) #are any of the row values NA ? apply(d,2,function(x)sum(is.na(x))) #how many values for each of

[R] Nested ANOVA with covariate using Type III sums of squares

2010-06-03 Thread Anita Narwani
Thanks for your response Joris. I was aware of the potential for aliasing, although I thought that this was only a problem when you have missing cell means. It was interesting to read the vehement argument regarding the Type III sums of squares, and although I knew that there were different positi

Re: [R] moving average on irregular time series

2010-06-03 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Gustaf Rydevik > Sent: Thursday, June 03, 2010 7:24 AM > To: r-help@r-project.org > Subject: [R] moving average on irregular time series > > Hi all, > > > I wonder if there is

Re: [R] data-management: Rowwise NA

2010-06-03 Thread moleps
-Any- was my fix... Appreciate it. //M On 3. juni 2010, at 21.33, Phil Spector wrote: > ?any > > Not really a reproducible answer, but I think you're looking > for > > apply(tes[,sam],1,function(x)any(is.na(x))) > > > - Phil Spector >

Re: [R] Nested ANOVA with covariate using Type III sums of squares

2010-06-03 Thread Anita Narwani
I would just like to add that when I remove the co-variate of Mean.richness from the model (i.e. eliminating the non-orthogonality), the aliasing warning is replaced by the following error message: "Error in t(Z) %*% ip : non-conformable arguments" That is when I enter this model: carbonmean<-lm(C

[R] lmer() with no intercept

2010-06-03 Thread array chip
Hi, I am wondering how I can specify no intercept in a mixed model using lmer(). Here is an example dataset attached ("test.txt"). There are 3 workers, in 5 days, measured a response variable "y" on independent variable "x". I want to use a quadratic term (x2 in the dataset) to model the relat

[R] setMethod does not work in Window 7??

2010-06-03 Thread Fang, Jianwen
I am developing a S4 class but have had trouble to make setMethod work in Window 7. I tested an example found in the setMethod manual: > require(graphics) > setMethod("plot", signature(x="track", y="missing"), + function(x, y, ...) plot(slot(x, "x"), slot(x, "y"), ...) + ) It gave

Re: [R] R linux install: FORTRAN compiling error

2010-06-03 Thread vaneet
Thanks for your help, I was able to get someone with root access to execute the yum command for me and install R on the linux machine and it work!! -- View this message in context: http://r.789695.n4.nabble.com/R-linux-install-FORTRAN-compiling-error-tp2240821p2242362.html Sent from the R help

Re: [R] string handling

2010-06-03 Thread Wu Gong
Hope it helps. text <- "var1var2 9G/G09abd89C/T90 10A/T932C/C 90G/G A/A" x <- read.table(textConnection(text), header = T) x$var1.1 <- sub(".*(.)/.*", "\\1", x$var1) x$var1.2 <- sub(".*/(.).*", "\\1", x$var1) x$var2.1 <- sub(".*(.)/.*", "\\1", x$var2) x$var2.2 <- sub(".*/(.

Re: [R] Sweave glm.fit

2010-06-03 Thread Jimmy Söderly
Thanks for your help. Does it have something to do with the mcmc package, the coda package, or the lattice package ? Jimmy 2010/6/3 Gavin Simpson > On Wed, 2010-06-02 at 20:29 +0200, Jimmy Söderly wrote: > > Dear R users, > > > > After running Sweave, this is what I get : > > > > Warning messa

[R] Memory leak using Rgraphviz

2010-06-03 Thread Andreas Yankopolus
I'm running an Ubuntu 10.04 system and installed R 2.10.1 through the package manger. I then installed Rgraphviz 1.24 and graph 1.26 through R. I'm trying to understand why a complex function my team wrote causes R's memory footprint viewed through top to increase every time it's run. I traced t

Re: [R] Sweave glm.fit

2010-06-03 Thread Gavin Simpson
On Thu, 2010-06-03 at 23:44 +0200, Jimmy Söderly wrote: > Thanks for your help. > > Does it have something to do with the mcmc package, the coda package, or the > lattice package ? Is there something stopping you checking this for yourself? You have the code *you* are running, after all, and we d

Re: [R] Memory leak using Rgraphviz

2010-06-03 Thread Corey Dow-Hygelund
It appears you are facing a garbage collection issue. ?gc Corey On Thu, Jun 3, 2010 at 3:13 PM, Andreas Yankopolus wrote: > I'm running an Ubuntu 10.04 system and installed R 2.10.1 through the > package manger. I then installed Rgraphviz 1.24 and graph 1.26 through R. > > I'm trying to unders

Re: [R] Memory leak using Rgraphviz

2010-06-03 Thread Andreas Yankopolus
I should have mentioned in my initial email: running gc() doesn't help. You can run something like the following and watch memory usage soar: for (ii in 1:1) { foo() gc() } Thanks, Andreas On Jun 3, 2010, at 18:24, Corey Dow-Hygelund wrote: > It appears you are facing a garbage col

Re: [R] Nested ANOVA with covariate using Type III sums of squares

2010-06-03 Thread Joris Meys
Could you copy the data? Data <- data.frame(C.Mean,Mean.richness,Zoop,Diversity,Phyto) dput(Data) I have the feeling something's wrong there. I believe you have 48 observations (47df + 1 for the intercept), 2 levels of Diversity, 4 of Phyto and 48/(3*4)=4 levels of Zoop. But you don't have 3df fo

Re: [R] Question about avoid the for loop

2010-06-03 Thread Carrie Li
Thanks! Jorge Just one more question I don't get it even after checking help For option, why just using with(d,...), ifelse works on stratum indexed by x automatically ? Since in with, we didn't specify the stratum is indexed by x, what if you have another categorical variable in the data ? Thanks

Re: [R] Nested ANOVA with covariate using Type III sums of squares

2010-06-03 Thread Joris Meys
I see where my confusion comes from. I counted 4 levels of Phyto, but you have 8, being 4 in every level of Diversity. There's your aliasing. > table(Diversity,Phyto) Phyto Diversity M1 M2 M3 M4 P1 P2 P3 P4     H  0  0  0  0  6  6  6  6     L  6  6  6  6  0  0  0  0 There's no ne

Re: [R] Faster union of polygons?

2010-06-03 Thread Remko Duursma
Thanks for the tip - this cleans up the code a lot! Unfortunately, there is no gain in speed. remko On Thu, Jun 3, 2010 at 10:46 PM, nikhil kaza wrote: > Reduce might work. Not sure about the speed advantages though. It does > simplify code. > >  Unionall <- function(x) Reduce('union', x) > le

Re: [R] Nested ANOVA with covariate using Type III sums of squares

2010-06-03 Thread Joris Meys
Hi Anita, I have to correct myself too, I've been rambling a bit. Off course you don't delete the variable out of the interaction term when you test the main effect. What I said earlier didn't really make any sense. That testing a main effect without removing the interaction term is has a tricky

[R] reformat time from hhmm

2010-06-03 Thread Peter Moore
Hi, I'm newish to R, a recent convert from Matlab... So far I'm impressed, and determined to solve the following problem, which seems like it should be easy: I have a long (millions of points) data series recorded with a datalogger that produced a timestamp in 4 columns: Year, Day of Year, Time in

[R] two columns into one

2010-06-03 Thread moleps
Dear R´ers, How can I create one single factor variable from two variables incorporating all possible combinations of the values?? test<-sample(c("A",NA,"B"),100,replace=T) test2<-sample(c("E",F,"A"),100,replace=T) tes<-cbind(test,test2) pseduocode: r<-function(test,test2) r AE AF AA NA

Re: [R] Matrix subsetting with rownames

2010-06-03 Thread Muppy
Hi, this is what I want to do and what I found prior to ask there, but I wanted to do that with a vector of several hundreds or thounsands of names. Because I will have to use different vectors of very big size, my main concern was how to import this vector from a textfile (so I just have to chang

[R] Subsetting for unwanted values

2010-06-03 Thread LCOG1
Hi all, I have toyed with this for too long today and in the past i used multiple lines of code to get at what i want. Consider the following: All i need to do is subset Pc to the values that do not equal Pc.X. The first attempt doesnt work because i have unequal lengths. The second attemp

Re: [R] moving average on irregular time series

2010-06-03 Thread Gabor Grothendieck
Replace the non-events with NA and then use na.locf from the zoo package to move the last event date up to give lastEvent. Then simply select those rows whose lastEvent date is at least 14 days ago or if the row itself is an Event: > library(zoo) # na.locf > > lastEvent <- with(exData, na.locf(ife

[R] using string as variable name in model

2010-06-03 Thread Roni Kobrosly
Hi, I made a small table of strings that will serve as variable names for lm models I will run. The table looks like this: > varnames numname 11 zCANTAB_log_IED_totaltrials 22 zCANTAB_log_IED_preED 33zCANTAB_logPALerrors 44

Re: [R] cumsum function with data frame

2010-06-03 Thread Joris Meys
But then you don't apply cumsum within each factor level. Hence the ddply. Cheers Joris On Thu, Jun 3, 2010 at 9:35 PM, Jorge Ivan Velez wrote: > Or better yet, you can use transform only (in base): > transform(Data, CUMSUM = cumsum(value)) > HTH, > Jorge > > On Thu, Jun 3, 2010 at 3:30 PM, Feli

Re: [R] Subsetting for unwanted values

2010-06-03 Thread Joris Meys
> PcToAdd_<-Pc[!(Pc %in% Pc.X)] > PcToAdd_ [1] "Res" "Os" "Gov" "Rur" > PcToAdd_<-subset(Pc,!(Pc %in% Pc.X)) > PcToAdd_ [1] "Res" "Os" "Gov" "Rur" > On Fri, Jun 4, 2010 at 1:52 AM, LCOG1 wrote: > > Hi all, >   I have toyed with this for too long today and in the past i used multiple > lines

Re: [R] cumsum function with data frame

2010-06-03 Thread Jorge Ivan Velez
Thanks Joris, you are absolutely right. Apologies to all for that. May be this time I can get it right :-) transform(Data, CUMSUM = do.call(c, with(Data, tapply(value, rev(variable), cumsum Regards, Jorge On Thu, Jun 3, 2010 at 8:04 PM, Joris Meys <> wrote: > But then you don't apply cumsu

Re: [R] Question about avoid the for loop

2010-06-03 Thread Carrie Li
Hi Jorge, I found a problem. I just want to check if the answer is random, I change the code as follows: > d <- data.frame(x, t) > y <- with(d, ifelse(t == 0, rbinom(2, 1, 0.5), rnorm(3))) > > cbind(x, t,y) x t y [1,] 1 0 0.000 [2,] 1 0 0.000 [3,] 1 1 0.8920037 [4,] 1 1

Re: [R] ARIMA order

2010-06-03 Thread David Scott
nuncio m wrote: Hi all, Is there any way in R to select the order of an ARIMA model automatically nuncio Rob Hyndman's package forecast has a function auto.arima which produces an automatic arima fit, including for seasonal models. David Scott -- ___

Re: [R] Question about avoid the for loop

2010-06-03 Thread Jorge Ivan Velez
Hi Carrie, It works just fine in this case because you have the same number of 0's and 1's within each strata. If that would not be the case, option 1 would not work. That's why I provided you a second option. Best, Jorge On Thu, Jun 3, 2010 at 7:24 PM, Carrie Li <> wrote: > Thanks! Jorge > Ju

Re: [R] Nested ANOVA with covariate using Type III sums of squares

2010-06-03 Thread Anita Narwani
Hi Joris, That seems to have worked and the contrasts look correct. I have tried comparing the results to what SPSS produces for the same model. The two programs produce very different results, although the model F statistics, R squared and adjusted R squared values are identical. The results are s

Re: [R] Question about avoid the for loop

2010-06-03 Thread Carrie Li
Yes, in my case here, each strata has the same number of 0's and 1's. But I want the y to be randomly generated within each strata, so y should have some difference across the strata. (at least for the rnorm part we would see much clear randomness) (I hope what I am asking here is clear to you. )

Re: [R] Nested ANOVA with covariate using Type III sums of squares

2010-06-03 Thread Joris Meys
SPSS uses a different calculation. As far as I understood, they test main effects without the covariate. Regarding the difference between my and your results, did you use sum contrasts? options(contrasts=c("contr.sum","contr.poly")) On Fri, Jun 4, 2010 at 2:19 AM, Anita Narwani wrote: > Hi Joris,

Re: [R] Question about avoid the for loop

2010-06-03 Thread Jorge Ivan Velez
Hi Carrie, Try running the following: # function to create y using binomials and normals # -- this function is based on option 2 makey <- function(d){ spd <- with(d, split(d, x)) do.call(c, lapply(spd, function(comp) with(comp, ifelse(t == 0, rbinom(sum(t==0), 1, 0.2), rnor

Re: [R] Subsetting for unwanted values

2010-06-03 Thread Jorge Ivan Velez
Check ?"%in% HTH, Jorge On Thu, Jun 3, 2010 at 7:52 PM, LCOG1 <> wrote: > > Hi all, > I have toyed with this for too long today and in the past i used multiple > lines of code to get at what i want. Consider the following: > > All i need to do is subset Pc to the values that do not equal Pc.

Re: [R] Continous variables with implausible transformation?

2010-06-03 Thread zhu yao
THX Yao Zhu Department of Urology Fudan University Shanghai Cancer Center Shanghai, China 2010/6/4 Frank E Harrell Jr > On 06/03/2010 11:32 AM, Joris Meys wrote: > >> You're right, it is the same. using I() won't work for the same reason >> sqrt >> don't, so : >> >> x2<- x^2 >>> lrm(y~x+x2)

Re: [R] two columns into one

2010-06-03 Thread Jorge Ivan Velez
Hi there, May be expand.grid() ? HTH, Jorge On Thu, Jun 3, 2010 at 5:55 PM, moleps <> wrote: > Dear R´ers, > > > How can I create one single factor variable from two variables > incorporating all possible combinations of the values?? > > > test<-sample(c("A",NA,"B"),100,replace=T) > test2<-sam

Re: [R] Nested ANOVA with covariate using Type III sums of squares

2010-06-03 Thread Anita Narwani
Yes I understood the strangeness of removing a main effect without interactions that contain it because I did this during my efforts using model simplification. I had checked out the link you sent a couple of days ago. It was useful. So does Type II SS remove both the factor and any interactions co

Re: [R] reformat time from hhmm

2010-06-03 Thread nikhil kaza
?ifelse > t2 <- ifelse(nchar(times)<4, paste(" ", times, sep=""), times) > strptime(t2, "%H%M") Nikhil On Thu, Jun 3, 2010 at 5:21 PM, Peter Moore wrote: > Hi, > I'm newish to R, a recent convert from Matlab... So far I'm impressed, and > determined to solve the following problem, which seems

Re: [R] reformat time from hhmm

2010-06-03 Thread nikhil kaza
Minor correction below. Use 0 instead of space if you are using %H On Thu, Jun 3, 2010 at 8:55 PM, nikhil kaza wrote: > ?ifelse > > > t2 <- ifelse(nchar(times)<4, paste("0", times, sep=""), times) > > > strptime(t2, "%H%M") > > Nikhil > > > > On Thu, Jun 3, 2010 at 5:21 PM, Peter Moore wrote: >

Re: [R] using string as variable name in model

2010-06-03 Thread Phil Spector
Roni - Try this: lm(formula(paste(outcome,'income + covariate1 + coviarate2',sep='~')), data=my.data) -> model - Phil Spector Statistical Computing Facility Department of

Re: [R] reformat time from hhmm

2010-06-03 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Peter Moore > Sent: Thursday, June 03, 2010 2:22 PM > To: r-help@r-project.org > Subject: [R] reformat time from hhmm > > Hi, > I'm newish to R, a recent convert from Matlab... S

Re: [R] General-purpose GPU computing in statistics (using R)

2010-06-03 Thread Dirk Eddelbuettel
Ravi, On 3 June 2010 at 09:43, Ravi Varadhan wrote: | I have been reading about general purpose GPU (graphical processing units) | computing for computational statistics. I know very little about this, but | I read that GPUs currently cannot handle double-precision floating points | and also tha

Re: [R] Overlay of barchart and xyplot

2010-06-03 Thread Felix Andrews
Hi Huapeng, Firstly, it is worth noting that it is often not recommended to overlay series with different scales, so you should think about other ways to present your data. Secondly, when posting here it is much more helpful to provide the data in a form that can be copied-and-pasted into R: so r

Re: [R] Faster union of polygons?

2010-06-03 Thread Martin Morgan
On 06/03/2010 04:54 PM, Remko Duursma wrote: > Thanks for the tip - this cleans up the code a lot! > Unfortunately, there is no gain in speed. Playing a little bit dirty, punion <- function(...) { n <- nargs() if (0L == n) new("gpc.poly") else if (1L == n && is(..1, "gpc.poly")) .

[R] horizontal and vertical line with arrow in a plot

2010-06-03 Thread Roslina Zakaria
Hi r-users, I would like to add a plot of vertical line segment with arrow from (77,.6) to (77,0) and also a horizontal  line segment with arrow from (0,0.6) to (77,.6) .  So far this is what I have: plot(sq, cdf, type="l", lwd=4,col="blue",xaxs="i",yaxs="i", xlab= "Rainfall (mm)", ylab= "Rand

Re: [R] horizontal and vertical line with arrow in a plot

2010-06-03 Thread Peter Alspach
Tena koe Roslina ?arrows HTH Peter Alspach > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Roslina Zakaria > Sent: Friday, 4 June 2010 3:34 p.m. > To: r-help@r-project.org > Subject: [R] horizontal and vertical line wi

Re: [R] import text file into R

2010-06-03 Thread Dhanasekaran
Sorry guys It is a tab delimited text file which I just exported from SAS. I want to import this in R. Pl let me know what is the delimiter I should use and R syntax. Thanks On Thu, Jun 3, 2010 at 9:20 PM, Sarah Goslee wrote: > That sounds like a good plan. > > What went wrong? > > You'r

[R] glmpath crossvalidation

2010-06-03 Thread Brian Tsai
Hi all, I'm relatively new to using R, and have been trying to fit an L1 regularization path using coxpath from the glmpath library. I'm interested in using a cross validation framework, where I crossvalidate on a training set to select the lambda that achieves the lowest error, then use that val

[R] R Newbie, please help!

2010-06-03 Thread Jeff08
Hello Everyone, I just started a new job & it requires heavy use of R to analyze datasets. I have a data.table that looks like this. It is sorted by ID & Date, there are about 150 different IDs & the dataset spans 3 million rows. The main columns of concern are ID, date, and totret. What I need

Re: [R] two columns into one

2010-06-03 Thread Wu Gong
Try unique and paste. paste(unique(tes)[,1], unique(tes)[,2], sep = "") - A R learner. -- View this message in context: http://r.789695.n4.nabble.com/two-columns-into-one-tp2242516p2242658.html Sent from the R help mailing list archive at Nabble.com. __

[R] i need help about reverse axes

2010-06-03 Thread Ali Alsamawi
Hello im trying to plot 3d with scatterplot packages , everything is work on my program below but my problenm i want to set my pressure level or axis(z-axis) to reverse like from bottom to top, i used function "rev" but not work just for 2d plots the figure in attachment and the program

Re: [R] import text file into R

2010-06-03 Thread Erik Iverson
Dhanasekaran wrote: Sorry guys It is a tab delimited text file which I just exported from SAS. I want to import this in R. Pl let me know what is the delimiter I should use and R syntax. You still don't say the error you're getting when you try your read.table command. __

Re: [R] R Newbie, please help!

2010-06-03 Thread Joshua Wiley
Hello Jeff, Try this: test <- data.frame(totret=rnorm(10^7)) #create some sample data test[-1,"dailyreturn"] <- test[-1,"totret"]/test[-nrow(test),"totret"] The general idea is to take the column "totret" excluding the first 1, dividided by "totret" exluding the last row. This gives in effect t

Re: [R] ordinal variables

2010-06-03 Thread Iasonas Lamprianou
Thanks, I'll have a go and will let you know. I guess that the success has to do with how efficiently I help them to demonstrate the efficiency of code over menues. So part of the issue is how I teach them as well... Dr. Iasonas Lamprianou Assistant Professor (Educational Research and Evaluat

Re: [R] import text file into R

2010-06-03 Thread Dhanasekaran
please look at the error.. > LosA<-read.table("E:\\Temporary Tasks\\rub\\Los_R\\ca_los.txt",header=T,sep="\t") Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, : line 11022 did not have 87 elements ca_los.txt is my tab delimited large text file which contains about 16l

Re: [R] R Newbie, please help!

2010-06-03 Thread Jeff08
Hey Josh, Thanks for the quick response! I guess I have to switch from the Java mindset to the matrix/vector mindset of R. Your code worked very well, but I just have one problem: Essentially I have a time series of stock A, followed by a time series of stock B, etc. So there are break points

[R] parttioning a matrix corresponding to different levels of y

2010-06-03 Thread suman dhara
Sir, I have a problem regarding partitioning a matrix.I state my problem as follows: I have a y vector of length say 1000.Variable y has 4 levels say 0,1,2.Corresponding to each y(response), I have a x-vector(explanatory) as a row of X matrix.Now, I want to partition the X matrix into 3 submatrice

Re: [R] R Newbie, please help!

2010-06-03 Thread Jeff08
Hey Josh, Thanks for the quick response! I guess I have to switch from the Java mindset to the matrix/vector mindset of R. Your code worked very well, but I just have one problem: Essentially I have a time series of stock A, followed by a time series of stock B, etc. So there are break points

Re: [R] Faster union of polygons?

2010-06-03 Thread Remko Duursma
Martin, thanks a lot! This speeds things up so much Do you mind if I bundle your punion function in a package I am developing (but of course I will name you the author of the function)? greetings, Remko On Fri, Jun 4, 2010 at 12:17 PM, Martin Morgan wrote: > On 06/03/2010 04:54 PM, Remk

Re: [R] parttioning a matrix corresponding to different levels of y

2010-06-03 Thread sayan dasgupta
Suman take a look if this suffices your purpous x <- data.frame(y=as.factor(sample(0:2,1000,replace=TRUE)),x=runif(1000)) x1 <- x[x$y==0,] x2 <- x[x$y==1,] x3 <- x[x$y==2,] On Fri, Jun 4, 2010 at 10:29 AM, suman dhara wrote: > Sir, > I have a problem regarding partitioning a matrix.I state my pr

[R] Boxplot: what is shown by default?

2010-06-03 Thread Thomas von Känel
hi, i'm using /"boxplot()"/ to show some data: x <- c(0.99, 0.97, 0.91, 0.72, 1.00, 0.99, 1.02, 0.90, 0.91, 0.90, 1.02, 0.90, 1.35, 1.01, 0.92) boxplot(x) is it correct when i say: /"Boxes represent interquartile ranges (IQRs); bold horizontal lines, medians; whiskers, lowest and highest values

[R] R implementation for Text analytics

2010-06-03 Thread Christofer Bogaso
Hi there, is there any R package which address the "Text analytics" topic? It would also be great if someone point me about some good text books on "Text analytics" and what statistical tools and techniques are generally used on that field. Thanks and regards, [[alternative HTML version d

Re: [R] R Newbie, please help!

2010-06-03 Thread Joshua Wiley
Hey Jeff, I have a few ideas. Each has some different requirements, and to help you choose, I bench marked them. ###START### ##Basic data > test <- data.frame(totret=rnorm(10^7), id=rep(1:10^4, each=10^3), > time=rep(c(1, rep(0, 999)), 10^4)) ##Option 1: probably the most general, but also t

[R] Help on ARFIMA modeling

2010-06-03 Thread ERIC AIDOO
Please I want to perform full data analysis using ARFIMA model but I dont know the right package that can perform all the necessary test on the time series data. ERIC AIDOO [[alternative HTML version deleted]] __ R-help@r-project.org mailing li

<    1   2