Re: [R] Adjusting axis labels on lattice xyplot

2016-10-15 Thread Rolf Turner
On 16/10/16 12:10, Rich Shepard wrote: On Sat, 15 Oct 2016, David Winsemius wrote: I am not the one to answer the windoze question but my Mac (being less sensible than Rolf) also pops up a help window when queried with ?xyplot() David, Well, on my Slackware system writing in emacs with ESS

[R] suppress labels in lattice barchart

2016-10-15 Thread Naresh Gurbuxani
I would like to print a barchart without labels for categorical variables.   What change should be made to below command? Thanks, Naresh boy.age <- data.frame(name = c("alpha", "beta", "charlie", "gerald"), age = c(7, 9, 6, 5)) boy.age$name <- with(boy.age, reorder(name, age)) # draws with nam

Re: [R] Adjusting axis labels on lattice xyplot

2016-10-15 Thread Rich Shepard
On Sat, 15 Oct 2016, David Winsemius wrote: I am not the one to answer the windoze question but my Mac (being less sensible than Rolf) also pops up a help window when queried with ?xyplot() David, Well, on my Slackware system writing in emacs with ESS ?read.csv() produces the error message

Re: [R] Adjusting axis labels on lattice xyplot

2016-10-15 Thread Rich Shepard
On Sun, 16 Oct 2016, Rolf Turner wrote: Presumably you are running (yeuccch) Windoze, Rolf, Not since mid-1997. Slackware-14.1 on this host. Rich __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/l

Re: [R] Adjusting axis labels on lattice xyplot

2016-10-15 Thread David Winsemius
> On Oct 15, 2016, at 3:48 PM, Rolf Turner wrote: > > On 16/10/16 11:28, Rich Shepard wrote: >> On Fri, 14 Oct 2016, Rich Shepard wrote: >> So typing ?xyplot at the console doesn't bring up a help page? That would imply that you need to reinstall R. >> >>> Will rebuild and re-in

Re: [R] Adjusting axis labels on lattice xyplot

2016-10-15 Thread Rolf Turner
On 16/10/16 11:28, Rich Shepard wrote: On Fri, 14 Oct 2016, Rich Shepard wrote: So typing ?xyplot at the console doesn't bring up a help page? That would imply that you need to reinstall R. Will rebuild and re-install tomorrow morning. Sigh. User error. I entered the string as a functio

Re: [R] Adjusting axis labels on lattice xyplot

2016-10-15 Thread Rich Shepard
On Fri, 14 Oct 2016, Rich Shepard wrote: So typing ?xyplot at the console doesn't bring up a help page? That would imply that you need to reinstall R. Will rebuild and re-install tomorrow morning. Sigh. User error. I entered the string as a function, e.g., ?xyplot() rather than by its na

Re: [R] Error in solve.default(object$hessian)

2016-10-15 Thread David Winsemius
> On Oct 15, 2016, at 3:37 AM, Ahmad Nursalim wrote: > > I have the problem use R > > Error in solve.default(object$hessian) > > system is computationally singular: reciprocal condition number = 1.42892e-30 > > > what is the problem ?and what it means > help me You should learn to help your

Re: [R] How to read prediction intervals given by predict()?

2016-10-15 Thread Jeff Newmiller
No, you need to specify the inputs corresponding to the next value in order to obtain a production for that point. Read ?predict.lm or whatever function is appropriate for your model about the newdata argument. -- Sent from my phone. Please excuse my brevity. On October 15, 2016 8:24:35 AM PDT

Re: [R] How to read prediction intervals given by predict()?

2016-10-15 Thread Rolf Turner
On 16/10/16 04:24, mviljamaa wrote: My conception of prediction intervals is the following: "a prediction interval gives an interval within which we expect next y_i to lie with a specified probability" So when using predict() for my model: predict(fit4, interval="prediction")[1:20,] I get:

Re: [R] Split strings based on multiple patterns (plain text)

2016-10-15 Thread Joe Ceradini
Thank you David Wolfskill, David Winsemius, and Gabor! All very helpful and interesting fixes for the problem (compiled below)! Now I will see which one works best on the 944 rows that each have a cell of smooshed attributes...the attribute names should be the same in all the rows, if there is any

Re: [R] Problem with sample(...,size = 1000000000,...)

2016-10-15 Thread jim holtman
I forgot to add that if you have less than 16GB of memory, then you were probably paging memory to disk and that would have take a much, much, longer time. When you are trying to do something BIG, do it in some smaller steps and look at the resources that it takes (memory, cpu, ...). Jim Holtman

Re: [R] Problem with sample(...,size = 1000000000,...)

2016-10-15 Thread jim holtman
Do you realize you are trying to create a vector with 1 billion entries, so this will take some time. How much memory do you have on your computer? Here are some times to generate increasing sample sizes. I have 16GB on my computer and it took only 30 seconds to generate the data and used almost

Re: [R] lag, count

2016-10-15 Thread jim holtman
Here is a solution using 'dplyr' > require(dplyr) > lag<-read.table(text=" ID, y1, y2 + 1,0,12/25/2014 + 1,125,9/15/2015 + 1,350,1/30/2016 + 2,0,12/25/2012 + 2,450,9/15/2014 + 2,750,1/30/2016 + 2, 656, 11/30/2016 + ",sep=",",header=TRUE) > > new_lag <- lag %>% + mutate(y2 = as.Date(y2

Re: [R] lag, count

2016-10-15 Thread Rui Barradas
I forgot about the sorting part and assumed the data.frame was already sorted. If not, after converting y2 to class Date, you can do lag <- lag[order(lag$ID, lag$y2), ] Rui Barradas Em 15-10-2016 19:45, Rui Barradas escreveu: Hello, Try the following. lag<-read.table(text=" ID, y1, y2 1,0,

Re: [R] lag, count

2016-10-15 Thread Rui Barradas
Hello, Try the following. lag<-read.table(text=" ID, y1, y2 1,0,12/25/2014 1,125,9/15/2015 1,350,1/30/2016 2,0,12/25/2012 2,450,9/15/2014 2,750,1/30/2016 2, 656, 11/30/2016 ",sep=",",header=TRUE) str(lag) lag$y2 <- as.Date(lag$y2, format = "%m/%d/%Y") str(lag) # 1) flag <- ave(lag$ID, lag$ID

[R] Error in solve.default(object$hessian)

2016-10-15 Thread Ahmad Nursalim
I have the problem use R Error in solve.default(object$hessian) system is computationally singular: reciprocal condition number = 1.42892e-30 what is the problem ?and what it means help me -- [[alternative HTML version deleted]] __ R-help@r-

[R] Problem with sample(...,size = 1000000000,...)

2016-10-15 Thread Huy Nguyễn
When I ran this code: " x<-sample(1:5,10,TRUE,c(0.1,0.2,0.4,0.2,0.1)) print(table(x)/10) plot(table(x)/10,type="h",xlab="x",ylab="P(x)") " My laptop was frozen and didn't respond. Although I used ctrl+alt+del to terminate r program, my laptop still did nothing. And I must re

[R] lag, count

2016-10-15 Thread Val
Hi all, I want sort the data by ID and Y2 then count the number of rows within IDs. Assign a "flag" variable to reach row starting from first to the last row. For instance, in the following data ID "1" has three rows and each row is assigned flag sequentially 1, 2,3. 2. In the second step, wi

[R] How to read prediction intervals given by predict()?

2016-10-15 Thread mviljamaa
My conception of prediction intervals is the following: "a prediction interval gives an interval within which we expect next y_i to lie with a specified probability" So when using predict() for my model: predict(fit4, interval="prediction")[1:20,] I get: fit lwr upr 1 491

[R] ggplot() and annotation_custom()

2016-10-15 Thread Marc Girondot via R-help
Until now I was using plot() and I check the possibility to shift to ggplot2. All is OK until now except to write text out of the plotting region [equivalent of par(xpd=TRUE); text(x, y, labels)]. I have found using google recommendation to use annotation_custom() but I still failed to print

Re: [R] Return.clean () - PerformanceAnalytics package

2016-10-15 Thread T.Riedle
Hi Jim, no, I calculated the return series in Excel and imported the data into R. Then I transformed the data into a vector as I need a vector object of asset returns and did the calculation. Kind regards, T. From: Jim Lemon Sent: 15 October 2016 11:06

Re: [R] Split strings based on multiple patterns

2016-10-15 Thread Gabor Grothendieck
Replace newlines and colons with a space since they seem to be junk, generate a pattern to replace the attributes with a comma and do the replacement and finally read in what is left into a data frame using the attributes as column names. (I have indented each line of code below by 2 spaces so if

Re: [R] Difficulties with setting working directory

2016-10-15 Thread Duncan Murdoch
On 14/10/2016 2:52 PM, Anže Dejak wrote: Greetings, Firstly, I'd hope this is the correct e-mail address to ask about specific problems refering to problems with R. If it isn't, I kindly ask of you to re-direct me to the correct contact person. So, the thing with my version of R (I'm using RStu

Re: [R] Difficulties with setting working directory

2016-10-15 Thread Jim Lemon
Hi Anze, I'm not sure that this will work on Windows, but you can create a function named ".First" (note the leading period) with something like this: .First<-function() setwd("C:/Users/anze") To do this, start a session, enter the above line and then quit the session, saving the current workspac

Re: [R] Return.clean () - PerformanceAnalytics package

2016-10-15 Thread Jim Lemon
Hi T, Have you tried converting "clearntest" or "data" into a time series? Jim On Sat, Oct 15, 2016 at 4:47 AM, T.Riedle wrote: > Dear all, > > I am trying to clean return data using the Return.clean() function in the > PerformanceAnalytics package. Hence, my code looks as follows but I get an