Hi Martin,
See inline below...
> On Jun 7, 2019, at 9:25 AM, Martin Maechler
> wrote:
>
>> Marc Schwartz via R-help
>>on Fri, 7 Jun 2019 09:07:21 -0400 writes:
>
>> Hi, Ok, some additional tweaks.
>
>> Relative to Bert's pointing out the aesthetic issues,
>> certainly, those are
Wow! I hadn't meant to set off such an email flurry... Tbh all I wanted to do
was to label some plots for my own recording and notes so Bert's idea was more
than adequate. On the other hand it's instructive to venture further into the
R-universe in such distinguished company...
Nick
> On 07
> Marc Schwartz via R-help
> on Fri, 7 Jun 2019 09:07:21 -0400 writes:
> Hi, Ok, some additional tweaks.
> Relative to Bert's pointing out the aesthetic issues,
> certainly, those are attributes that can be adjusted as
> Nick may require. I was focused more on the pri
Hi,
Ok, some additional tweaks.
Relative to Bert's pointing out the aesthetic issues, certainly, those are
attributes that can be adjusted as Nick may require. I was focused more on the
primary issue. Using "..." is an easy way to pass additional parameters to
plot.default() as Bert indicated.
These look like very fragile suggestions. Allow x^2 to be an argument
(named expr, for example) to plotFx, don't force a user to write a
function in a very particular way. Then use deparse(substitute(expr))
in the title.
Duncan Murdoch
On 06/06/2019 4:33 p.m., Bert Gunter wrote:
Well, if y
Well, if you want to do it this way, note that as written, the y axis
default label isn't "nice," and you should anyway allow for additional
graphical arguments (either way). Also, slightly better I think is to use
the built-in access function, body():
plotFx <- function(x, fun, ...) {
plot(x,
Hi,
Sorry for the misfire on the first attempt.
After seeing the clarifications, I thought about a possible way to do this,
perhaps a little more simply, while encapsulating the plotting in a function:
plotFx <- function(x, fun) {
plot(x, fun(x), main = paste0("Plot of y = ", deparse(fun)[2])
Yes, plot(z,y,..)
Bert
On Thu, Jun 6, 2019 at 9:21 AM Nick Wray wrote:
> Thanks Bert, that is exactly what I wanted. I think that you meant
> plot(z,y... in the last line?
>
> Nick
>
> On 06 June 2019 at 17:13 Bert Gunter wrote:
>
> ... and if you wanted too streamline the process, something
Thanks Bert, that is exactly what I wanted. I think that you meant plot(z,y...
in the last line?
Nick
> On 06 June 2019 at 17:13 Bert Gunter wrote:
>
> ... and if you wanted too streamline the process, something like the
> following could be encapsulated in a function:
>
> fun <- qu
... and if you wanted too streamline the process, something like the
following could be encapsulated in a function:
fun <- quote(exp(x))
z <- 1:9
y <- eval(fun,list(x = z) )
plot(x, y, main = paste("Plot of y =", deparse(fun)))
Further details can be found in the "Computing on the Language" secti
Thanks but that's not quite what I meant
I am trying out different functions and they don't necessarily vary in a
regular way (like say all being powers of x where it'd be simple to just have a
vector for the powers you want)
So I might have
y<-x^2
y<-cos(x)
y<-exp(x+1)
What I am after is a way o
The well known deparse(substitute(...)) construction.
plot(1:9, main = paste("plot of",deparse(substitute(y <- x^2
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 Jun 6, 2019, at 11:19 AM, Nick Wray via R-help
> wrote:
>
> Is there any way of taking a line of r code (eg y<-x^2) and pasting that line
> of code, as is, into a label, so that for example I could then have a plot
> label "Plot of y<-x^2"?
>
> Thanks Nick Wray
Hi,
See ?plotmath
A
Is there any way of taking a line of r code (eg y<-x^2) and pasting that line
of code, as is, into a label, so that for example I could then have a plot
label "Plot of y<-x^2"?
Thanks Nick Wray
[[alternative HTML version deleted]]
__
R-help@r
14 matches
Mail list logo