Re: [R] Error in loading tidyverse library

2021-12-09 Thread Bert Gunter
1. There is no "below" . Most attachments are stripped by the mail server.

2. Please read and follow the Posting Guide linked below. Your post did not.

3. RStudio is **not** R. In particular, the so-called TidyVerse
consists of all *non*-standard contributed packages, about which the
Posting Guide says:

"For questions about functions in standard packages distributed with R
(see the FAQ Add-on packages in R), ask questions on R-help.
[The link is:
https://cran.r-project.org/doc/FAQ/R-FAQ.html#Add-on-packages-in-R
This gives the list of current _standard_ packages]

If the question relates to a contributed package , e.g., one
downloaded from CRAN, try contacting the package maintainer first. You
can also use find("functionname") and
packageDescription("packagename") to find this information. Only send
such questions to R-help or R-devel if you get no reply or need
further assistance. This applies to both requests for help and to bug
reports."

Note that RStudio maintains its own help resources at:
https://community.rstudio.com/
This is where questions about the TidyVerse, ggplot, etc. should be posted.

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 Thu, Dec 9, 2021 at 11:59 AM Ekene Esiaka  wrote:
>
> Tidyverse cannot load on my rstudio as seen below.
>
> Thanks for your understanding.
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Error in loading tidyverse library

2021-12-09 Thread Ekene Esiaka
Tidyverse cannot load on my rstudio as seen below.

Thanks for your understanding.
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Forwarding missing arguments to the `[` method

2021-12-09 Thread Martin Maechler
> Ivan Krylov 
> on Wed, 8 Dec 2021 16:52:00 +0300 writes:

I have always learnt a lot about programming when reading other
people's code .. notably if those people new what they are
doing.

In this case, studying R-core's

`[.data.frame`  and

`[<-.data.frame`

{or for S4 methods, the 'Matrix' or 'Rmpfr' packages}

should show you a lot.

What you should take from there:
Do work with *both*
missing(drop)
and
nargs()

(and more)
in order to distinguish m[i] from m[i,] etc


Best,
Martin


> Got some progress on this, but still not sure how to continue. First, a
> much more simple script reproducing the behaviour that confuses me:

> foo <- function(x, ...) structure(x, class = 'foo')
> `[.foo` <- function(x, i, ..., drop = TRUE) {
>   print(sys.call())
>   print(match.call())
>   foo(NextMethod()) # x[] should return an object of class foo
> }
> `[<-.foo` <- function(x, i, ..., value) {
>   print(sys.call())
>   print(match.call())
>   x[i, ..., drop = FALSE]
>   # imagine that we need to perform some checks on the
>   # subset of x that we're about to replace
>   NextMethod()
> }
> 
> x <- foo(42)
> x[]  # this works
> x[] <- 1 # this doesn't
> 
> Now, the crucial difference between the x[] and x[] <- 1 calls is that
> in the former case, the `i` argument isn't even specified:
> 
> x[]
> # `[.foo`(x, )
> # `[.foo`(x = x)
> # [1] 42
> # attr(,"class")
> # [1] "foo"
> 
> While in the latter case, `i` is specified in the x[] call (but
> missing):
> 
> x[] <- 1
> # `[<-.foo`(`*tmp*`, , value = 1)
> # `[<-.foo`(x = `*tmp*`, value = 1)
> # x[i, ..., drop = FALSE]
> # `[.foo`(x = x, i = i, drop = FALSE)
> Error in NextMethod() : argument "i" is missing, with no default
> 
> What's the best way to forward the arguments from [<-.class methods to
> the [.class methods in order to handle cases like x[] properly?
> 
> -- 
> Best regards,
> Ivan
> 
> __

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.