Re: [R] Replace double slashes with single backslash

2020-12-28 Thread Anbu A
Thank you, Jim. That clarifies. I am trying to pass this path in a loop and read the files associated with the path. Yes the length is 26 where double quotes are counted as single quotes. Let me try to read the files using the collected path. Really appreciate it. Thanks, Anbu On Mon, Dec 28, 2

Re: [R] Error: Discrete value supplied to continuous variable

2020-12-28 Thread jim holtman
You setup your X & Y axis incorrectly. in your call to ggplot you have: g <-df %>% ggplot(aes(x=reorder(job,-span), y=span, fill=factor(job))) + but in your call to geom_rect you are using a completely different set of variables that is causing the error: geom_rect(aes(xmin = ID - w/2,

[R] Error: Discrete value supplied to continuous variable

2020-12-28 Thread King, Barry
I am attempting to convert an original schedule to longest operating time next schedule then create waterfall plot. I am having trouble with the plot. I get an Error: Discrete vale supplied to continuous variable message. My example code appears below. library(tidyverse) library(ggplot2) # ori

Re: [R] Replace double slashes with single backslash

2020-12-28 Thread jim holtman
Why do you want to replace '\\' with '\' in the file names? They are actually single '\' in the character string, but are printing out as '\\'. see example below: > x <- 'a\\b' > x [1] "a\\b" > nchar(x) [1] 3 Jim Holtman *Data Munger Guru* *What is the problem that you are

Re: [R] Replace double slashes with single backslash

2020-12-28 Thread Bert Gunter
"\" is an escape in R. See ?Quotes for details. 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 Mon, Dec 28, 2020 at 12:56 PM Anbu A wrote: > Hi All, > I am a

[R] Replace double slashes with single backslash

2020-12-28 Thread Anbu A
Hi All, I am able to replace "r" with "x" for the word "Users" just for a test run. *Code: newlist %>% mutate(.,new_col=str_replace(fpath,"r","x")) *- this works fine But when I try to replace "\\" with "\". *newlist %>% mutate(.,new_col=str_replace(fpath,"\\","\")) *, I get a prompt ">" to comple

Re: [R] Passing variable name

2020-12-28 Thread Avi Gross via R-help
There are endless ways to do what you want, Seyit. If you wish to remain in base R, using the names function on the left-hand side changes the names as in: names(something) <- c("new", "names") And in general, you may want to learn how to use an alternate set of methods that work well with ggpl

Re: [R] Passing variable name

2020-12-28 Thread Rui Barradas
Hello, In my previous post I had meant something like the following. The two important parts are the use of `[[` in table() and the use of get() in the ggplot call. MyData<-data.frame("Gender" = c("F", "F", "F", "F", "M", "M", "M", "M", "M", "M", "F", "F"), "Hand" = c(

Re: [R] Passing variable name

2020-12-28 Thread Seyit Ali KAYIS
Hi Bert, Thanks a lot for informing me regarding the html format of my email. I also would like to thank to Erdogan CEVHER and Jim LEMON for their kind reply/suggestions. Yes I am aware of names function in R which is not the one I am looking for in here. Let me try to explain in anothe

[R] Interpreting coefficient in selection and outcome Heckman models in sampleSelection

2020-12-28 Thread Marinella Cirillo via R-help
Dear Arne, I have just read the exchange of messages with Mark Bulling.I was wondering if you have discovered/developed a function to calculate the marginal effects of the selection and outcome equations (sampleSelection). Thank you Marinella [[alternative HTML version deleted]] ___