Re: [R] Removing a space from a string

2020-07-28 Thread Richard O'Keefe
The spaces may not have been VISIBLE in the Word document, but that does not mean that there wasn't anything THERE. - What happens if you open the document in Word and save it as plain text? - What happens if you open the document in Word and save it as RTF, then read that using read_rtf? -

[R] Bottom posting v top posting. Was: Arranging ggplot2 objects with ggplotGrob()

2020-07-28 Thread Rasmus Liland
This email thread has some seriously long messages in it, e.g. one is 243 lines long (i.e. 11K of plain text for something which could have been the size of a Post-It note), and people do not agree if top posting or bottom posting is, also this mime element gets attached by GNU Mailman to

Re: [R] Arranging ggplot2 objects with ggplotGrob()

2020-07-28 Thread H
On 07/28/2020 12:35 PM, Ulrik Stervbo wrote: > Would this work: > > ``` > library(ggplot2) > library(cowplot) > > p1 <- ggplot(iris, aes(x = Sepal.Length, y = Sepal.Width)) + geom_point() > p2 <- ggplot(iris, aes(x = Petal.Length, y = Petal.Width * 1000)) + > geom_point() > > plot_grid(p1, p2,

Re: [R] Removing a space from a string

2020-07-28 Thread Dennis Fisher
Richard In reply to your “first response”, the text was originally in a Word document and it did NOT contain the errant spaces. I used read_docx in the textreadr package to access the text. The spaces were added during that step. I am copying the maintainer of that package to see if he has

Re: [R] Removing a space from a string

2020-07-28 Thread Richard O'Keefe
The first response has to be "how did the spaces get there in the first place?" Can you fix the process that creates the data? If the process sometimes generates one extra space, are you sure it never generates two? But let's treat this purely as a regular expression problem, where if there is

Re: [R] Removing a space from a string

2020-07-28 Thread Bert Gunter
Note that my previous strategy can be expressed slightly more clearly as: x <- c("STRING 01. Remainder of the string", "STR ING 01. Remainder of the string", "STRIN G 01. Remainder of the string", "STR IN G 01. Remainder of the string") ## more spaces in this last example entry rx <-

Re: [R] Removing a space from a string

2020-07-28 Thread Bert Gunter
1. Thanks for the nice reprex. 2. However, I thought there was still a bit of ambiguity. I interpreted your specification to mean: "any number of spaces could occur in the beginning alphabetic part of the strings before one or more digits occur followed by a '.' (a period) and then more stuff

Re: [R] Removing a space from a string

2020-07-28 Thread Rasmus Liland
On 2020-07-28 23:00 +0200, Rasmus Liland wrote: | | Perhaps by using gregexpr to look for | dots, remove spaces from the substring until the first | finding, then pasting it back. | | strings <- | c("STRING 01. Remainder of the string.", | "STR ING 01. Remainder of the

Re: [R] rNOMADS Package

2020-07-28 Thread Roy Mendelssohn - NOAA Federal via R-help
two requested forecasts are listed below. > As you can see [[1]] is for 12 Z and [[2]] is for 13 Z – red in 18 point > type. > > RAPInfo > [[1]] > [[1]]$file.name > [1] > "C:\\Users\\Owner\\Documents\\Ballooning\\WeatherBriefing/rap.t12z.awp130pgrbf00.grib2.grb"

Re: [R] Removing a space from a string

2020-07-28 Thread cpolwart
This RegEx would do it I think: \s(?=.*\s\d*\.) Looks for space - \s Before any strings followed by space, numbers, period text <- "STR ING 01. Remainder of the string" stringr::str_replace_all(text, "\\s(?=.*\\s\\d*\\.)", "") Should do it I think! On 2020-07-28 21:34, Dennis Fisher wrote:

Re: [R] Removing a space from a string

2020-07-28 Thread Rasmus Liland
Dear Dennis, On 2020-07-28 13:20 -0700, Dennis Fisher wrote: | Colleagues | | I have strings that contain a space in | an unexpected location. The intended | string is: | “STRING 01. Remainder of the string" | However, variants are: | “STR ING 01. Remainder of the string" |

[R] rNOMADS Package

2020-07-28 Thread Philip
C:\\Users\\Owner\\Documents\\Ballooning\\WeatherBriefing/rap.t12z.awp130pgrbf00.grib2.grb" [[1]]$url [1] "https://nomads.ncep.noaa.gov/cgi-bin/filter_rap.pl?file=rap.t12z.awp130pgrbf00.grib2_800_mb=on_TMP=on=%2Frap.20200728; [[2]] [[2]]$file.name [1] "C:\\Users\\Owner\\Documents\\Bal

Re: [R] Removing a space from a string

2020-07-28 Thread Dennis Fisher
Only the spaces in STRING. However, if I inadvertently delete the space between STRING and NN, I can add it back in. Dennis Fisher MD P < (The "P Less Than" Company) Phone / Fax: 1-866-PLessThan (1-866-753-7784) www.PLessThan.com > On Jul 28, 2020, at 1:29 PM,

Re: [R] Removing a space from a string

2020-07-28 Thread Dennis Fisher
It is possible that there will be > 1 space. But, most likely only one (i.e., a solution for one space will suffice; a solution for > 1 space would be even better) Dennis Fisher MD P < (The "P Less Than" Company) Phone / Fax: 1-866-PLessThan (1-866-753-7784) www.PLessThan.com

Re: [R] Removing a space from a string

2020-07-28 Thread cpolwart
On 2020-07-28 21:31, Dennis Fisher wrote: Only the spaces in STRING. However, if I inadvertently delete the space between STRING and NN, I can add it back in. Can there only be one space in STR ING or is ST RI NG possible? Dennis Fisher MD P < (The "P Less Than" Company) Phone / Fax:

Re: [R] Removing a space from a string

2020-07-28 Thread cpolwart
On 2020-07-28 21:20, Dennis Fisher wrote: R 4.0.2 OS X Colleagues I have strings that contain a space in an unexpected location. The intended string is: “STRING 01. Remainder of the string" However, variants are: “STR ING 01. Remainder of the string" “STRIN G 01.

[R] Removing a space from a string

2020-07-28 Thread Dennis Fisher
R 4.0.2 OS X Colleagues I have strings that contain a space in an unexpected location. The intended string is: “STRING 01. Remainder of the string" However, variants are: “STR ING 01. Remainder of the string" “STRIN G 01. Remainder of the string" I would like a

Re: [R] Nonlinear logistic regression fitting

2020-07-28 Thread J C Nash
There is a large literature on nonlinear logistic models and similar curves. Some of it is referenced in my 2014 book Nonlinear Parameter Optimization Using R Tools, which mentions nlxb(), now part of the nlsr package. If useful, I could put the Bibtex refs for that somewhere. nls() is now

Re: [R] Nonlinear logistic regression fitting

2020-07-28 Thread Rasmus Liland
Dear Sebastien, On 2020-07-28 14:13 +, Sebastien Bihorel wrote: | Hi | | I need to fit a logistic regression | model using a saturable | Michaelis-Menten function of my | predictor x. The likelihood could be | expressed as: | | L = intercept + emax * x / (EC50+x) | | Which I guess

Re: [R] Nonlinear logistic regression fitting

2020-07-28 Thread Rui Barradas
Hello, Glad it can be of help. Post example data then, like this it's rather difficult to answer accurately. Rui Barradas �s 17:59 de 28/07/2020, Sebastien Bihorel escreveu: > Hi Rui, > > Thanks for your input. > > In my analysis, the MM model is not intended to fit continuous data > but must

Re: [R] Nonlinear logistic regression fitting

2020-07-28 Thread Sebastien Bihorel via R-help
Hi Rui, Thanks for your input. In my analysis, the MM model is not intended to fit continuous data but must be used within a logistic regression model of binary data. So, while useful in itself, the suggested example does not exactly apply. I appreciate your time

Re: [R] Nonlinear logistic regression fitting

2020-07-28 Thread Rui Barradas
Hello, glm might not be the right tool for the MM model but nls is meant to fit non-linear models. And, after an on-line search, there is also package drc, function drm. I will use the data and examples in the links below. (The second gave me right, it uses nls.) #install.packages("drc")

Re: [R] Arranging ggplot2 objects with ggplotGrob()

2020-07-28 Thread Ulrik Stervbo via R-help
Would this work: ``` library(ggplot2) library(cowplot) p1 <- ggplot(iris, aes(x = Sepal.Length, y = Sepal.Width)) + geom_point() p2 <- ggplot(iris, aes(x = Petal.Length, y = Petal.Width * 1000)) + geom_point() plot_grid(p1, p2, ncol = 1, align = "hv", rel_heights = c(2, 1)) ``` Best, Ulrik

Re: [R] Nonlinear logistic regression fitting

2020-07-28 Thread Berry, Charles
Did you try searching for "Michaelis" on rseek.org? It seems like there are many hits that might be pertinent to your query. If none is pertinent, maybe saying why they are not sufficient will help others see how their "expert opinions" can help you. HTH, Chuck > On Jul 28, 2020, at 8:19

Re: [R] Nonlinear logistic regression fitting

2020-07-28 Thread Sebastien Bihorel via R-help
I hardly see how your reply addressed my question or any part of it. It looks to me that it was simply assumed that I did not perform any search before posting. From: Bert Gunter Sent: Tuesday, July 28, 2020 11:30 To: Sebastien Bihorel Cc: r-help@r-project.org

Re: [R] Nonlinear logistic regression fitting

2020-07-28 Thread Bert Gunter
You said: "As far as I know (please, correct me if I am wrong), fitting such a model is to not doable with glm, since the function is not linear." My reply responded to that. AFAIK, opinions on packages are off topic here. Try stats.stackexchange.com for that. Bert Gunter "The trouble with

Re: [R] Nonlinear logistic regression fitting

2020-07-28 Thread Sebastien Bihorel via R-help
Thank you for your subtle input, Bert... as usual! This is literally the search I conducted and spent 2 hours on before posting to R-help. I was asking for expert opinions, not for search engine FAQ! Thank anyways From: Bert Gunter Sent: Tuesday, July 28, 2020

Re: [R] Nonlinear logistic regression fitting

2020-07-28 Thread Bert Gunter
Search! ... for "nonlinear logistic regression" at rseek.org. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Tue, Jul 28, 2020 at 7:25 AM Sebastien Bihorel

Re: [R] Axis with inverse logarithmic scale

2020-07-28 Thread John Fox
Dear Martin, On 7/28/2020 10:17 AM, Martin Maechler wrote: Martin Maechler on Tue, 28 Jul 2020 15:56:10 +0200 writes: John Fox on Mon, 27 Jul 2020 12:57:57 -0400 writes: >> Dear Dileepkumar R, >> As is obvious from the tick marks, the vertical axis is not log-scaled:

Re: [R] Axis with inverse logarithmic scale

2020-07-28 Thread Martin Maechler
> Martin Maechler > on Tue, 28 Jul 2020 15:56:10 +0200 writes: > John Fox > on Mon, 27 Jul 2020 12:57:57 -0400 writes: >> Dear Dileepkumar R, >> As is obvious from the tick marks, the vertical axis is not log-scaled: >>> log10(99.999) - log10(99.99) >>

[R] Nonlinear logistic regression fitting

2020-07-28 Thread Sebastien Bihorel via R-help
Hi I need to fit a logistic regression model using a saturable Michaelis-Menten function of my predictor x. The likelihood could be expressed as: L = intercept + emax * x / (EC50+x) Which I guess could be expressed as the following R model ~ emax*x/(ec50+x) As far as I know (please,

Re: [R] Axis with inverse logarithmic scale

2020-07-28 Thread Martin Maechler
> John Fox > on Mon, 27 Jul 2020 12:57:57 -0400 writes: > Dear Dileepkumar R, > As is obvious from the tick marks, the vertical axis is not log-scaled: >> log10(99.999) - log10(99.99) > [1] 3.908865e-05 >> log10(99) - log10(90) > [1] 0.04139269 > That

Re: [R] Writing Persian (Arabic) in a data frame

2020-07-28 Thread John Kane
Just to agree with the other responses, note my default encoding is UTF-8. > A<-data.frame(x=c("مریم","ماریا"),y=c(1,1)) > A x y 1 مریم 1 2 ماریا 1 > str(A) 'data.frame': 2 obs. of 2 variables: $ x: chr "مریم" "ماریا" $ y: num 1 1 > sessionInfo() R version 4.0.2 (2020-06-22)

Re: [R] getting raster layer between December and march in 1-year raster

2020-07-28 Thread Ben Tupper
Hi, I encourage you to subscribe the r-sig-geo mailing list for questions regarding geospatial data handling. Subscribe here... https://stat.ethz.ch/mailman/listinfo/r-sig-geo While you have shown your code, you have been very specific about what the issue is and how you know it is not working.

Re: [R] Writing Persian (Arabic) in a data frame

2020-07-28 Thread Ivan Krylov
On Tue, 28 Jul 2020 10:31:07 +0430 Vahid Borji wrote: > A<-data.frame(x=c("مریم","ماریا"),y=c(1,1)) > The output is like this: > > x y1 > 12 > 1 This is one of those problems heavily affected by your version of R (does it have stringsAsFactors = TRUE

Re: [R] Writing Persian (Arabic) in a data frame

2020-07-28 Thread Duncan Murdoch
On 28/07/2020 2:01 a.m., Vahid Borji wrote: I am trying to make a data frame including two vectors. The first vector is a vector of Persian names, and the second vector is a vector of numbers. My code is as follows: A<-data.frame(x=c("مریم","ماریا"),y=c(1,1)) A But when I run these codes I do

Re: [R-es] Superponer mapas en ggplot

2020-07-28 Thread Manuel Mendoza
Gracias Juan Diego. Esa es exactamente la idea. Ahora me surge otro problema: aun mirando los ejemplos, y otros que busqué en Internet, no consigo que me represente los dos mapas. Uno es: geom_point(data=NCDS,aes(x=lon,y=lat,color= PA),shape=15,size=1) +

[R] getting raster layer between December and march in 1-year raster

2020-07-28 Thread ahmet varlı
I am using these codes but it is not work between december and march. I want to use dates for select layers but ı dont know how ı can do Could u help me? dir.create(dir.out1, showWarnings = F) dir.create(dir.out2, showWarnings = F) dir.create(dir.out3, showWarnings = F) for (year in

Re: [R-es] Superponer mapas en ggplot

2020-07-28 Thread Juan Diego Alcaraz-Hernández
Quizás lo tienes solucionado con el argumento alfa (para fijar un nivel de transparencia en el gráfico). Te mando un ejemplo: https://rpubs.com/daniballari/ggplot El mar., 28 jul. 2020 a las 8:26, Manuel Mendoza (< mmend...@fulbrightmail.org>) escribió: > Buenos días. Tengo dos mapas que

[R-es] Superponer mapas en ggplot

2020-07-28 Thread Manuel Mendoza
Buenos días. Tengo dos mapas que hago con ggplot (abajo) y necesito superponer el 2º al 1º. En el 1º se representa la variable PA, binomial (0, 1), en gris, y en el 2º la variable ExtTG7085, que es numérica y va de 0 a 200. La 2ª es un gradiente en rojo. Lo ideal sería que donde coinciden el rojo

[R] Writing Persian (Arabic) in a data frame

2020-07-28 Thread Vahid Borji
I am trying to make a data frame including two vectors. The first vector is a vector of Persian names, and the second vector is a vector of numbers. My code is as follows: A<-data.frame(x=c("مریم","ماریا"),y=c(1,1)) A But when I run these codes I do not receive my desired output. Indeed the