[R] Change the color of the line inside of the function lines

2013-09-16 Thread Arnaud Michel
Hi I have the following problem : I have 3 vectors xx, yy, zz : xx - c(5479, 6209, 6940, 7670, 8766, 9496, 10227, 11048, 11778, 12509, 13239, 13970, 14700, 15340, 15948) yy - c( 267, 275, 281, 287, 296, 306, 316, 325, 334, 351, 365, 377, 389, 419, 419) zz - c( 3, 3, 3, 3, 4, 4, 4, 4,

[R] is it possible to install R packages without admin rights on a work station

2013-09-16 Thread Charles Thuo
How can a person in a controlled environment install additional R packages.. Charles. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] Change the color of the line inside of the function lines

2013-09-16 Thread Tsjerk Wassenaar
Hi Michel, lines(xx,yy,col=zz-2,type=s) If you use a color vector, say cols, then you can also do lines(xx,yy,col=cols[zz-2],type=s) Hope it helps, Tsjerk On Mon, Sep 16, 2013 at 8:42 AM, Arnaud Michel michel.arn...@cirad.frwrote: Hi I have the following problem : I have 3 vectors xx,

Re: [R] Change the color of the line inside of the function lines

2013-09-16 Thread Arnaud Michel
Hi Tsjerk Thank you but the color always remains black ! I would want that the color changes on the same graph (color = 3 on the 4 first steps, col = 4 on 5 following steps Michel Le 16/09/2013 09:01, Tsjerk Wassenaar a écrit : Hi Michel, lines(xx,yy,col=zz-2,type=s) If you use a

Re: [R] Splitting data into two camps

2013-09-16 Thread PIKAL Petr
Hi -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Evan Sticca Sent: Friday, September 13, 2013 6:48 PM To: r-help@r-project.org Subject: [R] Splitting data into two camps Hello R-help, I have recently generated some

Re: [R] Change the color of the line inside of the function lines

2013-09-16 Thread Tsjerk Wassenaar
Hi Michel, In that case, you need to use segments: ?segments For a line, it works like: plot(xx,yy,type=n) segments(xx[-1],yy[-1],xx[-length(xx)],yy[-length(yy)],col=zz,lwd=2) For a step function, you'll have to do a bit more work :) Cheers, Tsjerk On Mon, Sep 16, 2013 at 9:20 AM, Arnaud

Re: [R] Change the color of the line inside of the function lines

2013-09-16 Thread Pascal Oettli
Hi, Maybe the following might help you: s - seq(length(xx)-1) plot(xx, yy, type=n) segments(xx[s], yy[s], xx[s+1], yy[s], col=zz, lwd=2) segments(xx[s+1], yy[s], xx[s+1], yy[s+1], col='grey') Regards, Pascal On 16/09/2013 15:42, Arnaud Michel wrote: Hi I have the following problem : I

Re: [R] Change the color of the line inside of the function lines

2013-09-16 Thread Arnaud Michel
Thanks Pascal and Tsjerk Michel Le 16/09/2013 09:42, Pascal Oettli a écrit : Hi, Maybe the following might help you: s - seq(length(xx)-1) plot(xx, yy, type=n) segments(xx[s], yy[s], xx[s+1], yy[s], col=zz, lwd=2) segments(xx[s+1], yy[s], xx[s+1], yy[s+1], col='grey') Regards, Pascal On

Re: [R] Non-ACSII characters in R on Windows

2013-09-16 Thread Milan Bouchet-Valat
Le vendredi 13 septembre 2013 à 23:38 +0400, Maxim Linchits a écrit : This is a condensed version of the same question on stackexchange here: http://stackoverflow.com/questions/18789330/r-on-windows-character-encoding-hell If you've already stumbled upon it feel free to ignore. My problem is

Re: [R] is it possible to install R packages without admin rights on a work station

2013-09-16 Thread Rolf Turner
On 09/16/13 19:01, Charles Thuo wrote: How can a person in a controlled environment install additional R packages... Use a local library in your user space. Create a directory --- I called mine Rlib, and it is located in my home directory. I.e. my local library is /home/rolf/Rlib. Then

Re: [R] is it possible to install R packages without admin rights on a work station

2013-09-16 Thread Daniel Hornung
On Monday, September 16, 2013 09:01:03 Charles Thuo wrote: How can a person in a controlled environment install additional R packages.. Charles. Hello Charles, a slight variation of what Rolf wrote, this is my setup: in my ~/.Rprofile (which is read at R's startup), I set the R_LIBS_USER

Re: [R] Instructions for upgrading R on ubuntu

2013-09-16 Thread Zhang Weiwu
On Sun, 15 Sep 2013, Andrew Crane-Droesch wrote: The c2d4u PPA is the main search result when googling upgrade R 3.0.1 ubuntu. And it should be, because it is more likely that a PPA re-distribution works better for Ubuntu than a general distribution, even if it is an exceptional case with

Re: [R] hclust/dendrogram merging

2013-09-16 Thread Thomas Parr
Josh, A couple of things: 1) It would be helpful if you can provide some reproducible data and the code you have developed thus far. 2) This is more of a stackexchange.com or crossvalidated.com question. That said...without seeing the data... Dendrograms/hclust are generated by using a distance

Re: [R] Non-ACSII characters in R on Windows

2013-09-16 Thread Milan Bouchet-Valat
Le lundi 16 septembre 2013 à 10:40 +0200, Milan Bouchet-Valat a écrit : Le vendredi 13 septembre 2013 à 23:38 +0400, Maxim Linchits a écrit : This is a condensed version of the same question on stackexchange here:

[R] Aggregate rows with same fields, within factors

2013-09-16 Thread Andrea Goijman
Dear R list, I want to aggregate the number of individuals 'IND' of the same ORDER, within each site and season CAMP,TRANS... but I also want to keep record of the habitat HAB and LOTE For example I have this: CAMP LOTE HAB TRANS IND ORDEN 1765 C1 B1 BB1 7 HEMIPTERA

Re: [R] Aggregate rows with same fields, within factors

2013-09-16 Thread arun
Hi, Try:  aggregate(IND~.,data=net1,sum)    CAMP LOTE HAB TRANS   ORDEN IND 1    C1   B1   C    C1   0 2    C1   B1   B    B3   ACARI   3 3    C1   B1   B    B1 ARANEAE   1 4    C1   B1   B    B3 ARANEAE   2 5    C1   B1   B    B3  COLEOPTERA   2 6    C1   B1   B   

Re: [R] Console Output Formatting

2013-09-16 Thread Noah Silverman
Neal, I like this answer. Simple and clean. Don't know why I didn't think of that before. Thanks! -- Noah Silverman, M.S., C.Phil UCLA Department of Statistics 8117 Math Sciences Building Los Angeles, CA 90095 On Sep 4, 2013, at 3:12 PM, Neal Fultz nfu...@gmail.com wrote: print(1:100)

Re: [R] Regression model for predicting ranks of the dependent variable

2013-09-16 Thread Greg Snow
What question (or questions) are you trying to answer? Any advice we may give will depend on what you are trying to accomplish. On Sat, Sep 14, 2013 at 2:12 PM, Saumya Gupta saumya.gu...@outlook.comwrote: I have a dataset which has several predictor variables and a dependent variable, score

[R] MASS mve_fits mycov.rob

2013-09-16 Thread Charlie Brown
Hello, In R 3.0.1, I get the following warning that I do not get in R 2.15.3: data(mtcars) mycov.rob(mtcars[,1:3], method=mcd) Error in .C(mve_fitlots, as.double(x), as.integer(n), as.integer(p), : mve_fitlots not available for .C() for package MASS It seems like there was a change in MASS?

Re: [R] Draw two separate legends in xyplot

2013-09-16 Thread Gesmann, Markus
Here is an example using grid functions, based on an example from Deepayan (https://stat.ethz.ch/pipermail/r-help/2005-April/069459.html) I hope this helps. library(grid) library(lattice) ft - grid.layout(nrow = 2, ncol = 4, heights = unit(rep(1, 2), lines), widths

[R] microbenchmark

2013-09-16 Thread Christophe Genolini
Hi the list, I am using the function microbenchmark to measure the performance of some code. But I notice that the first execution of the code takes much longueur than the next executions. I compare it to several executions of the code : --- 8 -- A - matrix(1:9,3) nbReroll - 1000

[R] Draw two separate legends in xyplot

2013-09-16 Thread Jun Shen
Hi all, I wonder if there is a way to draw two separate legends in xyplot as I would like to separate the legend for data and the legend for reference lines I add. I can use key argument to draw one legend with everything together. What I really want is to put one legend at the bottom and the

[R] Help to run bootstrap in R

2013-09-16 Thread amit khatri
Hello R Team,      Thanks for this gigantic software Called R. I am new to R software. My name is Amit Khatri and currently  I am working as a Research Student in Department of Economics University of Mumbai, Mumbai, India. I need your suggestion on How to use

Re: [R] Aggregate rows with same fields, within factors

2013-09-16 Thread arun
HI, Not sure how you wanted the results with the rows having NAs. net1[,sapply(net1,is.factor)]-lapply(net1[,sapply(net1,is.factor)],as.character)  with(net1,aggregate(IND,list(CAMP,LOTE,HAB,TRANS,ORDEN),FUN=sum)) #or with(net1,aggregate(IND,list(CAMP,LOTE,HAB,TRANS,ORDEN),FUN=sum,na.rm=TRUE))

Re: [R] Non-ACSII characters in R on Windows

2013-09-16 Thread Ista Zahn
UTF-8 on windows is a huge pain, this bites me often. Usually I give up and do the analysis on a Linux server. In previous struggles with this I've found this blog post enlightening: https://tomizonor.wordpress.com/2013/04/17/file-utf8-windows/ Best, Ista On Mon, Sep 16, 2013 at 10:38 AM, Milan

[R] set breakpoint in debug

2013-09-16 Thread Hui Du
Hi All, I need some help regarding how to set up a breakpoint in debug. For example, I have a very simple/naïve function (a useless function just for demo) f = function() { x = 10; len = 100; a = 1; for(i in 1:len) { a = a * i; } y = x + a; y; } If I need to

Re: [R] set breakpoint in debug

2013-09-16 Thread Simon Zehnder
You could just use debug(f) and then when the Browser opens and the loop begins type 'c', that jumps over the loop to next line after the loop. Best Simon On Sep 16, 2013, at 9:05 PM, Hui Du hui...@dataventures.com wrote: Hi All, I need some help regarding how to set up a breakpoint in

Re: [R] MASS mve_fits mycov.rob

2013-09-16 Thread arun
Hi, library(MASS) Couldn't find the function ?mycov.rob()  mycov.rob(mtcars[,1:3],method=mcd) #Error: could not find function mycov.rob ??mycov.rob No vignettes or demos or help files found with alias or concept or title matching ‘mycov.rob’ using regular expression matching. Though,  

Re: [R] set breakpoint in debug

2013-09-16 Thread Duncan Murdoch
On 16/09/2013 3:05 PM, Hui Du wrote: Hi All, I need some help regarding how to set up a breakpoint in debug. For example, I have a very simple/naïve function (a useless function just for demo) f = function() { x = 10; len = 100; a = 1; for(i in 1:len) { a =

Re: [R] Regression model for predicting ranks of the dependent variable

2013-09-16 Thread David Winsemius
On Sep 16, 2013, at 10:53 AM, Saumya Gupta wrote: I have a training dataset which contains statistics of football players for the year 2009, and their ranks for the year 2010. For example: RHelp is not the place to ask for help on homework or Kaggle challenges. Read:

Re: [R] Non-ACSII characters in R on Windows

2013-09-16 Thread Ista Zahn
Hi Duncan, I've put an example file online at https://docs.google.com/file/d/0B73Ve8vxnjR6QnRESXBQTHRUME0/edit?usp=sharing, with a screenshot showing the expected contents of the file at https://docs.google.com/file/d/0B73Ve8vxnjR6b1ZSQmtsRXdadVU/edit?usp=sharing Hopefully you'll find this easy

Re: [R] Non-ACSII characters in R on Windows

2013-09-16 Thread Milan Bouchet-Valat
Le lundi 16 septembre 2013 à 13:39 -0400, Duncan Murdoch a écrit : On 16/09/2013 12:04 PM, Maxim Linchits wrote: Here is that old post: http://r.789695.n4.nabble.com/read-csv-and-FileEncoding-in-Windows-version-of-R-2-13-0-td3567177.html In that post, you'll see I asked for a sample file.

[R] split on change occurence

2013-09-16 Thread srecko joksimovic
Hi, I had an example like this: iduseraction 1 12 login 2 12 view 3 12 view 4 12 view 5 12 login 6 12 view 7 12 view 8 12 login which I used to split using split(dat1,cumsum(dat1$action==login)). If I had a

Re: [R] split on change occurence

2013-09-16 Thread Rui Barradas
Hello, That's an even simpler case for ?split. dat - read.table(text = iduserIP 1 12 ip1 2 12 ip1 3 12 ip2 4 12 ip2 5 12 ip2 6 12 ip3 7 12 ip3 8 12 ip3 , header = TRUE) split(dat, dat$IP) Hope this

Re: [R] split on change occurence

2013-09-16 Thread srecko joksimovic
Thanks... I don't know why I didn't try... guess was in hurry... I apologize for posting such a simple question On Mon, Sep 16, 2013 at 3:44 PM, Rui Barradas ruipbarra...@sapo.pt wrote: Hello, That's an even simpler case for ?split. dat - read.table(text = iduserIP 1 12

Re: [R] MASS mve_fits mycov.rob

2013-09-16 Thread Charlie Brown
I missed that, thank you. This is from a function someone else wrote, and they modified cov.rob(); I will look through what they have done. Thank you. On Mon, Sep 16, 2013 at 2:05 PM, arun smartpink...@yahoo.com wrote: Hi, library(MASS) Couldn't find the function ?mycov.rob()

[R] Is R able to fit and forecast arima models using daily time series?

2013-09-16 Thread Paul Bernal
Hello everyone, I have been struggling quite a bit with R whenever I try to fit ARMA or ARIMA models and produce forecasts for datasets containing daily observations. Can somebody tell me whether R can handle daily time series or not? I have the impresion that R cannot fit nor produce forecasts

Re: [R] hclust/dendrogram merging

2013-09-16 Thread Peter Langfelder
Joshua, I'm not sure I understand your aim correctly, but if I do, here's my advice: If you are able to find the clusters according to rows or columns using clustering, you must be using some kind of a distance matrix that encodes whether two antibodies should be in one bin for rows, and a

Re: [R] How do you do this in R?

2013-09-16 Thread arun
Hi, Try:  sum(sapply(1:100,function(i) i^3+ 4*(i^2))) #[1] 26855900  169551560477066118158651749177/7963268583173904 #[1] 2129170437 sum(sapply(1:25,function(i) ((2^i)/i)+ ((3^i)/(i^2 #[1] 2129170437 A.K. I have done this on myself using paper and I know the answer for A is

Re: [R] Regression model for predicting ranks of the dependent variable

2013-09-16 Thread Greg Snow
You might consider Projection Pursuit Regression (ppr function). Since the ranking is just a monotone transformation of the underlying score, ppr can estimate the transformation and the contribution of the terms into the score. On Mon, Sep 16, 2013 at 11:53 AM, Saumya Gupta

Re: [R] problem with grep under loop

2013-09-16 Thread MacQueen, Don
to understand the argument is of length zero message, study these example: if (grep('a',c('a','b'))==1) 'a' else 'b' [1] a if (grep('a',c('c','b'))==1) 'a' else 'b' Error in if (grep(a, c(c, b)) == 1) a else b : argument is of length zero grep('a',c('c','b')) integer(0)

Re: [R] Non-ACSII characters in R on Windows

2013-09-16 Thread Duncan Murdoch
On 16/09/2013 12:04 PM, Maxim Linchits wrote: Here is that old post: http://r.789695.n4.nabble.com/read-csv-and-FileEncoding-in-Windows-version-of-R-2-13-0-td3567177.html In that post, you'll see I asked for a sample file. I never received any reply; presumably some spam filter didn't like

Re: [R] Data labels in R

2013-09-16 Thread MacQueen, Don
Possibly the text() function. -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 On 9/15/13 9:43 AM, Ankur Seth ankurset...@gmail.com wrote: I want to put labels a,b,c,d on the data points

Re: [R] Regression model for predicting ranks of the dependent variable

2013-09-16 Thread Saumya Gupta
I have a training dataset which contains statistics of football players for the year 2009, and their ranks for the year 2010. For example: Player No. of goals No. of matches Age Rank (in 2010) A 5 1 35 1 B 2 4 23 2 C 1 7 26 3

Re: [R] Executing a code until a new user input aborts it (readlines?)

2013-09-16 Thread Greg Snow
Here is one approach that uses the tcltk package to create a button on a different loop than yours, clicking the button will change a variable (ShouldIStop) in a temporary environment that both your look and the tk button can access. The loop then just checks the variable from time to time and

Re: [R] Data labels in R

2013-09-16 Thread Ankur Seth
Yes Mac, text function did it. Thanks All for your help. text(dfPlot$Date, dfPlot$RECLTD,dfPlot$Labels, col=642) On Tue, Sep 17, 2013 at 12:00 AM, MacQueen, Don macque...@llnl.gov wrote: Possibly the text() function. -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave.,

Re: [R] Help to run bootstrap in R

2013-09-16 Thread Rui Barradas
Hello, As for a general purpose bootstrap routine, at an R prompt type the following. library(boot) ?boot Manu other boot strap functions from other packages are available. Good luck searching. Hope this helps, Rui Barradas Em 16-09-2013 13:45, amit khatri escreveu: Hello R Team,

Re: [R] Aggregate rows with same fields, within factors

2013-09-16 Thread Andrea Goijman
it works, but it eliminates the rows with NA is there a way to keep those? On Mon, Sep 16, 2013 at 11:22 AM, arun smartpink...@yahoo.com wrote: Hi, Try: aggregate(IND~.,data=net1,sum) CAMP LOTE HAB TRANS ORDEN IND 1C1 B1 CC1 0 2C1 B1 BB3

Re: [R] How do you do this in R?

2013-09-16 Thread arun
Hi, No problem. Please ?dput() your dataset. dat- read.table(text= strategy region result conservative desert 64.68427 moderate mountains 10.880242 moderate desert 48.72387 aggressive desert 34.37877 aggressive mountains 37.43783 moderate grassland 60.572490 aggressive forest 5.193187

Re: [R] Is R able to fit and forecast arima models using daily time series?

2013-09-16 Thread Pascal Oettli
Hello, R is able to handle daily time series. A problem arises when you have to deal with leap years. zoo is able to manage 365 or 366 days a year, while ts is not able to do that, . But as far as I read, most of ARMA, ARIMA or SARIMA works with ts, not with zoo. Maybe some else might provide you

Re: [R] A factor times a matrix

2013-09-16 Thread arun
Hi,  t(a*t(b)) # [,1] [,2] #[1,]    1    8 #[2,]    2   10 #[3,]    3   12 A.K. Hello eveybody, I have a vector a and a matrix b : a [1] 1 2 b [,1] [,2] [1,] 1 4 [2,] 2 5 [3,] 3 6 With simple multiplication I get : a * b [,1] [,2] [1,] 1 8 [2,] 4 5 [3,] 3 12 I would

Re: [R] A factor times a matrix

2013-09-16 Thread Pascal Oettli
Hello, To complete Arun's response, you also have: sweep(b,2,a,'*') [,1] [,2] [1,]18 [2,]2 10 [3,]3 12 or b %*% diag(a) [,1] [,2] [1,]18 [2,]2 10 [3,]3 12 Regards, Pascal 2013/9/17 arun smartpink...@yahoo.com Hi, t(a*t(b)) # [,1]