[Rd] matplot.Date & matplot.POSIXct

2020-01-24 Thread Spencer Graves



Hello, All:


  Roughly a decade ago, I added "matplot.Date" and 
"matplot.POSIXct" to the "fda" package, so we could get reasonable 
labeling of the horizontal axis when "x" was class "Date" or "POSIXct".  
I also added a local version of "matplot.default" that just changes the 
defaults for "xlab" and "ylab".



  Would anyone care to comment on this?


  In particular, might there be any interest among the R Core Team 
of adding "matplot.Date" and "matplot.POSIXct" to the "graphics" package?



  Secondarily, might anyone have any thoughts about the defaults 
for "xlab" and "ylab" in "graphics::matplot"?



  I ask, because the Jim Ramsay, Giles Hooker and I are preparing a 
new release of "fda", and Jim asked me if we needed to to have "matplot" 
masking "graphics::matplot".  Rather than answer that question, I 
thought I would ask a larger question of this group.



  Thanks,
  Spencer Graves

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] How to get an object name from C?

2020-01-24 Thread Daniel Cegiełka


(earlier I sent it as html by mistake).

Hi,

How can I get from C an object name used as a function argument? I
have sample code in C that gives me access to the name of the function
being called:


SEXP xname(SEXP x)
{
const char *fun_name = CHAR(PRINTNAME(CAR(x)));
x =  CDR(x);
const char *arg_name = isNull(TAG(x)) ? "" : CHAR(PRINTNAME(TAG(x)));

Rprintf("fn_name: %s, arg_name: %s\n", fun_name, arg_name);
return R_NilValue;
}


> xname <- function(...) invisible(.External("xname", ...))
>
> x1 = 123
>
> xname(x1)
fn_name: xname, var_name:


However, I am trying to find a way to access the object name. In the
documentation I found a solution for named args:


> xname(arg = x1)
fn_name: xname, var_name: arg


And I'd like to find the equivalent in C for substitute():

> substitute(x1)
x1


Best regards,
Daniel

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] How to get an object name from C?

2020-01-24 Thread Michael Lawrence via R-devel
Since substitute() is implemented in C, you could look at its implementation.

On Fri, Jan 24, 2020 at 1:09 AM Daniel Cegiełka
 wrote:
>
>
> (earlier I sent it as html by mistake).
>
> Hi,
>
> How can I get from C an object name used as a function argument? I
> have sample code in C that gives me access to the name of the function
> being called:
>
>
> SEXP xname(SEXP x)
> {
> const char *fun_name = CHAR(PRINTNAME(CAR(x)));
> x =  CDR(x);
> const char *arg_name = isNull(TAG(x)) ? "" : CHAR(PRINTNAME(TAG(x)));
>
> Rprintf("fn_name: %s, arg_name: %s\n", fun_name, arg_name);
> return R_NilValue;
> }
>
>
> > xname <- function(...) invisible(.External("xname", ...))
> >
> > x1 = 123
> >
> > xname(x1)
> fn_name: xname, var_name:
>
>
> However, I am trying to find a way to access the object name. In the
> documentation I found a solution for named args:
>
>
> > xname(arg = x1)
> fn_name: xname, var_name: arg
>
>
> And I'd like to find the equivalent in C for substitute():
>
> > substitute(x1)
> x1
>
>
> Best regards,
> Daniel
>
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



-- 
Michael Lawrence
Senior Scientist, Bioinformatics and Computational Biology
Genentech, A Member of the Roche Group
Office +1 (650) 225-7760
micha...@gene.com

Join Genentech on LinkedIn | Twitter | Facebook | Instagram | YouTube

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel