Re: [R] Creating a conditional lag variable in R

2019-07-26 Thread Jim Lemon
Hi Faradj, There is a problem with your structure statement in that the hyphen (-) following the left angle bracket (<) has been transformed into a fancy hyphen somewhere in the process. I replaced it with an ordinary hyphen and it worked okay. Also, your coding for "B" seems to include the first y

Re: [R] Creating a conditional lag variable in R

2019-07-26 Thread Bert Gunter
Because you posted in HTML, your example got mangled and resulted in an error. Re-post in *plain text* please (making sure that you cut and paste correctly) Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breat

[R] Creating a conditional lag variable in R

2019-07-26 Thread Faradj Koliev
Dear R-users, I’ve a rather complicated task to do and need all the help I can get. I have data indicating whether a country has signed an agreement or not (1=yes and 0=otherwise). I want to simply create variable that would capture the years before the agreement is signed. The aim is to see

Re: [R] Reading recurring data in a text file

2019-07-26 Thread Ista Zahn
Here is another possibility library(stringr) readterm <- function(term, text) { lapply(str_split(text, fixed(term))[[1]][-1], fread, skip = 4, nrows = 5 ) } easymethod <- function(whalines) { whalines <- str_c(whalines, collapse = "\n") lapply(c(srchStr1, srchSt

Re: [R] NIR spectra analysis using Caret package

2019-07-26 Thread Bert Gunter
This post does not meet the standards for posting on this list. Read and follow the posting guide (linked below) to learn how to post properly on this list. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breat

Re: [R] install_github broken for dependencies on packages previously installed from private github repo.

2019-07-26 Thread Duncan Murdoch
You posted this identical question to https://stackoverflow.com/q/57206597/2554330, and didn't fix it based on the comment asking for a reproducible example. Please don't crosspost. On 25/07/2019 3:15 p.m., Mark Mendel wrote: When installing from a private repo, fails if the package depends o

[R] NIR spectra analysis using Caret package

2019-07-26 Thread manoj oak via R-help
Dear R members, I would like to know the complete analysis of NIR spectra analysis and prediction of wheat grain quality, using Caret, PLS R packages.  with best regardsManoj Oak If you judge people, you have no time to love them. -- Mother Teresa Manoj D Oak Ph. D. Scientist Genetics Department

Re: [R] "rgb()" problem

2019-07-26 Thread Röver , Christian
Sorry, I meanwhile realized -- specifying rgb(255, 128, 128, alpha=0.5*255, maxColorValue=255) and rgb(1.0, 0.5, 0.5, alpha=0.5, maxColorValue=1) gives you (virtually) identical results, i.e., you need to also specify the "alpha" parameter in the range given by the "maxColorValue" argument.

[R] [R-pkgs] New package MBNMAdose: dose-response meta-analysis

2019-07-26 Thread Hugo Pedder
Hi all, I would like to introduce you to a new package available on CRAN for performing meta-analysis of dose-response relationships, 'MBNMAdose'. For anyone who has performed a meta-analysis or network meta-analysis before, you might be aware of the difficulties of including different doses of a

Re: [R] "rgb()" problem

2019-07-26 Thread Ivan Krylov
On Fri, 26 Jul 2019 08:27:07 + "Röver, Christian" wrote: > The apparently buggy version in this case seems to return white > instead of red. I think it's red, but fully transparent. Alpha follows the same rules as red, green and blue components; it is expected to be in range [0; maxColorValu

[R] "rgb()" problem

2019-07-26 Thread Röver , Christian
Hi, I experienced a problem with the "rgb()" function. These two calls should (and do) return identical results: rgb(255, 128, 128, maxColorValue=255) rgb(1.0, 0.5, 0.5, maxColorValue=1) However, when I specify a non-default "alpha" channel (a "transparent" colour), I get differing results: