Re: [R] supply chain, operations, and sales optimization in R

2020-02-19 Thread Bert Gunter
Ummm... rather vague, and I certainly have no clue. But if you haven't already done so, have a look here: https://cran.r-project.org/web/views/ And of course, you should always try googling, e.g. on "supply chain optimization using R" , etc. Bert Gunter "The trouble with having an open mind is

[R] supply chain, operations, and sales optimization in R

2020-02-19 Thread Jeff Reichman
R-Help Forum Anyone ever perform supply chain optimization, operations optimization or sales optimization in R? If so what packages should I look to? Sincerely Jeff Reichman (314) 457-1966 [[alternative HTML version deleted]] ___

Re: [R] Annotate question

2020-02-19 Thread Rui Barradas
Hello, If groups are factors, pass the level you want to annotate. This works, note the 'x' value: ggplot(iris, aes(Species, Petal.Length)) + geom_boxplot() + annotate(geom = "text", x = "versicolor", y = 6, label = "16 u") Hope this helps, Rui Barradas Às 20:26 de 19/02/20, Thomas Subi

Re: [R] Annotate question

2020-02-19 Thread Stefan Schreiber
Since factor levels (groups) are coded by integers, you can use 1, 2, 3 etc. as your x values. If you want to annotate in between you can simply pick values in between 1, 2, 3, etc. On Wed, Feb 19, 2020, 13:26 Thomas Subia, wrote: > Colleagues, > > To add an annotation using ggplot, I've used >

[R] Annotate question

2020-02-19 Thread Thomas Subia
Colleagues, To add an annotation using ggplot, I've used annotate("text",x=17,y=2130,label="16 u"). However, this does not work when trying to annotate box plots by groups since groups are factors. Any advice would be appreciated. Thomas Subia ASQ CQE IMG Companies  225 Mountain Vista Parkw

Re: [R] Converting irregular time series data into ts object

2020-02-19 Thread Gabor Grothendieck
Sorry there were some errors in my email. Use this instead. Assuming that they both cover the same period of time then if you are willing to throw away some points then consider using only these 256 elements from the 305 series round(seq(1, 305, length = 256)) ## [1] 1 2 3 5 That is

Re: [R] Converting irregular time series data into ts object

2020-02-19 Thread Gabor Grothendieck
Assuming that they both cover the same period of time then if you are willing to throw away some points then consider using only these 256 elements from the 305 series round(seq(1, 305, length = 50)) ## [1] 1 7 13 20 26 32 38 44 ...etc... That is use the 1st ,7th, 13th, etc. point i

Re: [R] Package httr::GET() question

2020-02-19 Thread Roy Mendelssohn - NOAA Federal via R-help
Thanks. Yes. I did that, it also has a verbose mode so that I could see what it was doing. What I needed was not just escaping but strict escaping. My memory forma number of years back was that I had issues with urlencode from base not being strict. And of course you don't what to encode t

Re: [R] How to index the occasions in a vector repeatedly under condition 1? if not, it will give a new index.

2020-02-19 Thread William Dunlap via R-help
Use cumsum(logicalVector) to increment a counter at the TRUE positions in logicalVector. . E.g., > d <- c(NA, 0, 0, 0, 8, 0, 577, 69, 0) > is_true <- function(x) !is.na(x) & x > 1 + cumsum( is_true(d >= 15) ) [1] 1 1 1 1 1 1 2 3 3 Some packages have the equivalent of that is_true function, which

Re: [R] Package httr::GET() question

2020-02-19 Thread Ben Tupper
Hi, Perhaps you could test it out by using httr::GET() with and without escaping using xml2::url_escape()? https://www.rdocumentation.org/packages/xml2/versions/1.2.2/topics/url_escape Cheers, Ben On Tue, Feb 18, 2020 at 1:29 PM Roy Mendelssohn - NOAA Federal via R-help wrote: > > Hi All: > >

[R] How to index the occasions in a vector repeatedly under condition 1? if not, it will give a new index.

2020-02-19 Thread Lijun Zhao
Dear all, Could you please help me how to get the output as I described in the following example? x<-c(543, 543, 543, 543, 551 , 551 ,1128 ,1197, 1197) diff<-x-lag(x) diff [1] NA 0 0 0 8 0 577 69 0 How to index the occasions in x repeatedly if the diff<15? if diff>=15, it will

Re: [R] Converting irregular time series data into ts object

2020-02-19 Thread Jeff Newmiller
You should read about statistical imputation and decide what approach is appropriate for your data. This mailing list is for questions about R, not about statistics. Once you know what algorithm you need to apply, look up R functions that implement that algorithm using Google or the CRAN Task Vi

[R] Converting irregular time series data into ts object

2020-02-19 Thread Upananda Pani
Dear All, I want to convert irregular time series daily data in to ts objects. For some years I have 305 days data and some years I have 256 days. I need your suggestion regarding the same. I have read tutorial on the same but not able to find solutions. With regards, Upananda [[altern

Re: [R] How to index the occasions in a vector repeatedly under condition 1? if not, it will give a new index.

2020-02-19 Thread Rui Barradas
Hello, Yes, or even simpler is to assume that the first group starts at the first element of x, a reasonable assumption. cumsum(c(TRUE, diff(x) > 15)) Hope this helps, Rui Barradas Às 10:36 de 19/02/20, PIKAL Petr escreveu: Hi You could get similar result with using diff function Rui sug

Re: [R] How to index the occasions in a vector repeatedly under condition 1? if not, it will give a new index.

2020-02-19 Thread PIKAL Petr
Hi You could get similar result with using diff function Rui suggested c(1,cumsum((diff(x)>15))+1) [1] 1 1 1 1 1 1 2 3 3 Cheers Petr > -Original Message- > From: R-help On Behalf Of Rui Barradas > Sent: Wednesday, February 19, 2020 8:13 AM > To: Lijun Zhao ; r-help@r-project.org > Subj