Re: [R] [Rd] Open a file which name contains a tilde

2019-06-12 Thread Kurt Hornik
> Duncan Murdoch writes: With c76695 in the trunk, we now only tilde expand file names starting with a tilde also when using readline. Best -k > On 11/06/2019 4:34 p.m., William Dunlap via R-devel wrote: >> Note that R treats tildes in file names differently on Windows and Linux. >> On Windo

Re: [R] reg expr that retains only bracketed text from strings

2019-06-12 Thread Eric Berger
Hi Nevil, Here's one way to do it. (No doubt some regular-expression-gurus will have more concise ways to get the job done.) a1 <- sub(".*\\(","\\(",mystrings) a2 <- sub("\\).*","\\)",a1) a2[grep("\\(",a2,invert=TRUE)] <- "" a2 HTH, Eric On Wed, Jun 12, 2019 at 8:46 AM nevil amos wrote: > H

Re: [R] Changing the label name in the plot

2019-06-12 Thread Subhamitra Patra
Dear Sir, Thank you very much. The code which you suggested worked like awesome magic which gave the expected result what I really wanted. For this help, I shall be always grateful to you. Last time also, your intelligent help, and encouraging support had solved my problem. I really appreciate you

Re: [R] reg expr that retains only bracketed text from strings

2019-06-12 Thread Ivan Krylov
On Wed, 12 Jun 2019 15:45:04 +1000 nevil amos wrote: > # my desired desired output: > #[1] "" "(B)" "(C)" (function(s) regmatches( s, gregexpr('\\([^)]+\\)', s) ))(c("ABC","A(B)C","AB(C)")) # [[1]] # character(0) # # [[2]] # [1] "(B)" # # [[3]] # [1] "(C)" This matches a

Re: [R] Changing the label name in the plot

2019-06-12 Thread Jim Lemon
It is good to see someone learning about how the code works, beyond just getting the answer. 1) The header argument means, "is the first line of the file a header?". In this case it should be TRUE. the stringsAsFactors argument means "should character strings be converted to factors" (a combinatio

[R] mixtools' normalmixEM find cut-off between populations are reproduce graph

2019-06-12 Thread Luigi Marongiu
Dear all, I am using mixtools' normalmixEM to find a cut-off that can separate two populations. I can run the model, but I have two problems: 1. how do I find the value that separates the two populations? The model provides two density plots, what would be the value that is at the intersection betw

Re: [R] LaTeX Error in creating manual from Rd files

2019-06-12 Thread Helmut Schütz
Hi, Duncan Murdoch wrote on 2019-06-12 01:15: you should have  \describe{    \item{bar}{ \tabular{ll}{ ...    } Sorry, I have to come back. As I wrote before, no more errors/warnings, manual built. \itemize{   \item example   \describe{     \item{foo}{     \tabular{ll}{   

[R] ezAnova difficulties

2019-06-12 Thread paladini
Hello, I am using ezAnova for the first time and I am a bit lost. My data "epindata" looks like this: studno faculty epin smoker 1 16 2 2 2 16 1 3 2 18 2 4 2 24 1 5 3 15 2 6

Re: [R] reg expr that retains only bracketed text from strings

2019-06-12 Thread William Dunlap via R-help
strcapture() can help here. > mystrings<-c("ABC","A(B)C","AB(C)") > strcapture("^[^{]*(\\([^(]*\\)).*$", mystrings, proto=data.frame(InParen="")) InParen 1 2 (B) 3 (C) Classic regular expressions don't do so well with nested parentheses. Perhaps a perl-style RE could do that. > strc

Re: [R] LaTeX Error in creating manual from Rd files

2019-06-12 Thread Bert Gunter
This is really the wrong list for this discussion. Post on r-package-devel instead. Cheers, Bert On Wed, Jun 12, 2019 at 4:38 AM Helmut Schütz wrote: > Hi, > > Duncan Murdoch wrote on 2019-06-12 01:15: > > you should have > > > > \describe{ > >\item{bar}{ > > \tabular{ll}{ > > .

[R] Please help with ggplot error

2019-06-12 Thread Bill Poling
#RStudio Version 1.2.1335 sessionInfo() #R version 3.6.0 Patched (2019-05-19 r76539) #Platform: x86_64-w64-mingw32/x64 (64-bit) #Running under: Windows 10 x64 (build 17134) Hello I am getting an error for which I have googled to remedy but have not found a resource for it. I found this but it

Re: [R] Please help with ggplot error

2019-06-12 Thread Rui Barradas
Hello, Works with me, as soon as I corrected "Loess" to "loess". Hope this helps, Rui Barradas Às 18:56 de 12/06/19, Bill Poling escreveu: #RStudio Version 1.2.1335 sessionInfo() #R version 3.6.0 Patched (2019-05-19 r76539) #Platform: x86_64-w64-mingw32/x64 (64-bit) #Running under: Windows 1

Re: [R] Please help with ggplot error

2019-06-12 Thread Bill Poling
Oh my, sheesh! Oh my gosh! UGH! Thank you Rui! WHP From: Rui Barradas Sent: Wednesday, June 12, 2019 2:03 PM To: Bill Poling ; r-help (r-help@r-project.org) Subject: Re: [R] Please help with ggplot error Hello, Works with me, as soon as I corrected "Loess" to "loess". Hope this helps, R

Re: [R] Please help with ggplot error

2019-06-12 Thread Bill Poling
Well spoke too soon, maybe not for me Rui, weird? g1 <- ednet %>% + ggplot(aes(Date2,NetEditRev)) + + geom_line(alpha=0.5, color = "#2c3e50") + + geom_smooth(method = "loess", span= 0.5) +#Fix Loess to loess + theme_tq() Error in UseMethod("margin") : no applicable method for 'margin' ap

Re: [R] Please help with ggplot error

2019-06-12 Thread Rui Barradas
Hello, This seems to be a conflict with a generic function margin() from another package you might have loaded. ggplot::margin is not generic, therefore there are no methods for it. And its arguments have default values, it wouldn't throw an error even when called with no arguments. (As it is

Re: [R] Please help with ggplot error Resolved!

2019-06-12 Thread Bill Poling
Hello Rui, yes, I thought of that and rebooted RStudio and only loaded the specific pkgs for this project and that fixed that issue. Thank you Rui! WHP From: Rui Barradas Sent: Wednesday, June 12, 2019 3:01 PM To: Bill Poling ; r-help (r-help@r-project.org) Subject: Re: [R] Please help with

Re: [R] Open a file which name contains a tilde

2019-06-12 Thread John via R-help
On Wed, 5 Jun 2019 18:07:15 +0200 Frank Schwidom wrote: In reading file names, names with spaces require escaping of the spaces, and you are using not only a tilde but the space as spell. The tilde is conventionally read as wild card representing the leading portion of the file address, which is

Re: [R] reg expr that retains only bracketed text from strings

2019-06-12 Thread Jim Lemon
Hi Nevil, In case you are still having trouble with this, I wrote something in R that should do what you want: mystrings<-c("ABC","A(B)C","AB[C]","BC","{AB}C") get_enclosed<-function(x,left=c("(","[","<","{"),right=c(")","]",">","}")) { newx<-rep("",length(x)) for(li in 1:length(left)) { for(