Re: [R] [External] Adding a superscript 6 to a number

2020-12-29 Thread Duncan Murdoch
On 29/12/2020 4:15 p.m., Jeff Newmiller wrote: Why not? Is that a generalization, or specific to this case? paste and expression are used several times in the code that was posted. The one that causes all the trouble is labels=paste(PNotSusp,"=\n",mylab) where mylab is an expression, the

Re: [R] [External] Re: [External] Adding a superscript 6 to a number

2020-12-29 Thread David Winsemius
On 12/29/20 3:45 PM, Jeff Newmiller wrote: This doesn't sound right. When you use expression() it freezes the syntax as the expression you wrote, so expression(paste(x^2,"[", m^2, "]")) is a perfectly valid plotmath expression. The expression() call is _not_ an "inverse" of paste because the

Re: [R] [External] Re: [External] Adding a superscript 6 to a number

2020-12-29 Thread Jeff Newmiller
This doesn't sound right. When you use expression() it freezes the syntax as the expression you wrote, so expression(paste(x^2,"[", m^2, "]")) is a perfectly valid plotmath expression. The expression() call is _not_ an "inverse" of paste because the presence of paste is supporting the inclusion

Re: [R] [External] Re: [External] Adding a superscript 6 to a number

2020-12-29 Thread Bert Gunter
... yes, more specifically: (from ?paste) "paste converts its arguments (*via* as.character ) to character strings, and concatenates them (separating them by the string given by sep). " More to the point, I would say, is that if you

Re: [R] [External] Re: [External] Adding a superscript 6 to a number

2020-12-29 Thread Richard M. Heiberger
It is a generalization. Don't use paste() and expression() together because paste is a sort-of inverse to expression. In this example I start by typing several characters, and the result of paste(expression()) is a string containing the characters I initially typed. > expression(12^6)

Re: [R] [External] Adding a superscript 6 to a number

2020-12-29 Thread Jeff Newmiller
Why not? Is that a generalization, or specific to this case? On December 29, 2020 7:54:22 AM PST, "Richard M. Heiberger" wrote: >paste() is the problem. don’t use paste with expression() > >On Tue, Dec 29, 2020 at 10:50 Sorkin, John >wrote: > >> Colleagues, >> >> I would like to create a

Re: [R] A Labeling the median

2020-12-29 Thread Jim Lemon
Hi Greg, I think what you want is: mtext (side=4, "median", col="firebrick4", at=median(walk_seconds)) "adj" defaults to 0.5 and is usually okay. It looks to me as though mtext has taken your _character_ strings as non-numeric and then tried to work something out with par("las"). Experts more

Re: [R] Fwd: Error in setting the parameter values of k

2020-12-29 Thread Neha gupta
Hello, I am sorry but after settings the value of C between 1 and 7, I get the following error message now: Error in self$assert(xs) : Assertion on 'xs' failed: The parameter 'C' can only be set if the following condition is met 'type {eps-svr, eps-bsvr}'. Instead the parameter value for

[R] A Labeling the median

2020-12-29 Thread Gregory Coats via R-help
After calling plot, I draw a horizontal line representing the median with aline. abline (h=median(walk_seconds), lty=1, lwd=2.0, col="firebrick4") Then, I want to label that line as the median and do so by calling mtext. mtext (side=4, "median", col="firebrick4", adj=“0.50”) The dilemma is I do

Re: [R] Adding a superscript 6 to a number

2020-12-29 Thread Bill Dunlap
And if you have multiple labels, use lapply with bquote: plot(1:5, sin(101:105)^2, type="n") text(2:4, sin(102:104)^2, labels=lapply(102:104, function(i)bquote(sin(.(i))^2))) -Bill On Tue, Dec 29, 2020 at 8:31 AM Bert Gunter wrote: > Does this do what you want? > > plot(0:1, 0:1) > x <- .25 >

Re: [R] Fwd: Error in setting the parameter values of k

2020-12-29 Thread Neha gupta
Thanks a lot, Milne and Patrick. I am going to change the values, hopefully the error message will disappear. Warm regards On Tue, Dec 29, 2020 at 5:53 PM Patrick (Malone Quantitative) < mal...@malonequantitative.com> wrote: > Likely, yes. Your error message says k must be at least 1, so

Re: [R] Fwd: Error in setting the parameter values of k

2020-12-29 Thread Patrick (Malone Quantitative)
Likely, yes. Your error message says k must be at least 1, so searching below 1 is probably your issue. Also, logically, zero nearest neighbors doesn't seem to make a lot of sense. Pat On Tue, Dec 29, 2020 at 11:01 AM Neha gupta wrote: > Thank you for your response. > > Are you certain that

Re: [R] Adding a superscript 6 to a number

2020-12-29 Thread Bert Gunter
Does this do what you want? plot(0:1, 0:1) x <- .25 text(.5,.5, labels = bquote(.(x)^6, list(x= x))) 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, Dec

Re: [R] Fwd: Error in setting the parameter values of k

2020-12-29 Thread Neha gupta
Thank you for your response. Are you certain that k = 0 is a legitimate setting? Since, the default value of k is 1, I wanted to search between the values of 0 to 3. Milne, Do you mean I have to provide both the lower and upper bounds greater than 1 in order to get rid of this error? On Tue,

Re: [R] [External] Adding a superscript 6 to a number

2020-12-29 Thread Richard M. Heiberger
paste() is the problem. don’t use paste with expression() On Tue, Dec 29, 2020 at 10:50 Sorkin, John wrote: > Colleagues, > > I would like to create a number (stored in the variable x) to the number > with the exponent of, i.e. the number to the sixth power. The code I have > tried, pasted

Re: [R] Fwd: Error in setting the parameter values of k

2020-12-29 Thread T. A. Milne via R-help
I am using mlr3 'fast nearest neighbor' leaner i.e. fnnIts parameter is 'k' which has a default value of 1. When I use tuningusing random search, I set the parameter of k as: lower= 0, upper=3But it gives an error messageError in self$assert(xs) : Assertion on 'xs' failed: k: Element 1 is not

[R] Adding a superscript 6 to a number

2020-12-29 Thread Sorkin, John
Colleagues, I would like to create a number (stored in the variable x) to the number with the exponent of, i.e. the number to the sixth power. The code I have tried, pasted below does not work. # create plot plot(x=0.2,y=0.2,xlim=c(0,1),ylim=c(0,1)) PNotSusp=0.69 # Create a string containing

[R] Fwd: Error in setting the parameter values of k

2020-12-29 Thread Neha gupta
I am using mlr3 'fast nearest neighbor' leaner i.e. fnn Its parameter is 'k' which has a default value of 1. When I use tuning using random search, I set the parameter of k as: lower= 0, upper=3 But it gives an error message Error in self$assert(xs) : Assertion on 'xs' failed: k: Element 1 is

Re: [ESS] [OT] Best Practices Emacs / ESS Mini-Webinars

2020-12-29 Thread Deepayan Sarkar via ESS-help
On Tue, Dec 29, 2020 at 4:07 AM Dirk Eddelbuettel via ESS-help wrote: > > > Hi Stephen, > > On 28 December 2020 at 16:23, Stephen Bond wrote: > | I have been struggling with trying to follow the steps in > | https://r-pkgs.org/ and the best thing would be to have a similar > | online book showing

[R] Error in setting the parameter values of k

2020-12-29 Thread Neha gupta
I am using nlr3 'fast nearest neighbor' leaner i.e. fnn Its parameter is km which has a default value of 1. When I use tuning using random search, I set the parameter of k as: lower= 0, upper=3 But it gives an error message Error in self$assert(xs) : Assertion on 'xs' failed: k: Element 1 is

Re: [ESS] [OT] Best Practices Emacs / ESS Mini-Webinars

2020-12-29 Thread Chris Wallace via ESS-help
I haven't edited the colledit because no one would recognise my initials! But I use doom Emacs, and run R via ESS over tramp. Happy to help with either topic. ⁣http://chr1swallace.github.io​ On 28 Dec 2020, 22:38, at 22:38, Dirk Eddelbuettel via ESS-help wrote: > >Hi Stephen, > >On 28