Re: [R] Replace double slashes with single backslash

2020-12-28 Thread Anbu A
20 PM Bert Gunter > wrote: > >> "\" 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 Berke

[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] Windows path backward slash

2020-12-24 Thread Anbu A
Thank you. Anbu. On Thu, Dec 24, 2020 at 12:12 PM Bill Dunlap wrote: > The "\n" is probably not in the file name. Does omitting it from the call > to str_c help? > > -Bill > > On Thu, Dec 24, 2020 at 6:20 AM Anbu A wrote: > >> Hi All, >> I am a n

Re: [R] Windows path backward slash

2020-12-24 Thread Anbu A
you could assign the result of the function call > outside the function and see what is in that new variable: > > ans <- fsasdat("all") > str(ans) > > On December 23, 2020 7:08:05 PM PST, Anbu A > wrote: > >Hi All, > >I am a newbie. This is my first pr

[R] Windows path backward slash

2020-12-24 Thread Anbu A
Hi All, I am a newbie. This is my first program. I am trying to read SAS dataset from below path. I added escape "\" along "\" found in path C:\Users\axyz\Desktop\sas\ but still not working. fsasdat<-function(dsn) { pat="C:\\Users\\axyz\\Desktop\\sas\\" str1=str_c(pat,dsn,".sas7bdat","\n")