rocker-org / rocker-versioned

Run current & prior versions of R using docker
https://hub.docker.com/r/rocker/r-ver
GNU General Public License v2.0
297 stars 169 forks source link

selectr package issue #63

Closed stevedoor closed 6 years ago

stevedoor commented 6 years ago

Using the tidyverse image, when using the rvest::html_nodes function with a css selector, am receiving the following error:

Error in xpath_combinedselector(<S4 object of class "CombinedSelector">) :
  could not find function "xpath_combinedselector"
Calls: %>% ... lapply -> FUN -> selector_to_xpath -> <Anonymous> -> do.call

Referencing this stackoverflow post the issue seems to be with the r-cran-selectr version on apt.

Installing selectr with Rscript -e "install.packages('selectr')" indeed fixes the issue. I've updated the Dockerfile's install2_r script as such.

To clarify: this problem doesn't exist outside of the containerized environment

eddelbuettel commented 6 years ago

Please file a Debian bug report against r-cran-selectr showing what happens.

(I maintain a sizeable chunk of r-cran-* and try to keep them current; I have been fighting with the Debian Med / Debian Science team to do the same but I keep coming up short.)

stevedoor commented 6 years ago

@eddelbuettel sure thing

cboettig commented 6 years ago

@srs70187 Thanks for the bug report (here and the one for Debian)!. Your issue here says 'Using the tidyverse image...' but doesn't say how you've installed selectr on the tidyverse image. I'd recommend just using install.packages() in the usual way (which can also be done in any interactive session and does not need root). That shouldn't have any problems. I'm guessing you're doing apt-get install r-cran-selectr instead?

Note that the in the versioned stack, R is build from source so you can have access to the desired version (e.g. rocker/tidyverse:3.3.1 vs rocker/tidyverse:3.4.3) A consequence of this is that running apt-get install r-cran-* will also install the binary debian version of R that all such deb packages depend on, which means in most cases you may end up with a second version of R... Just a heads up.

stevedoor commented 6 years ago

@cboettig sure thing. To clarify I'm not installing the selectr package before the error, it's already included with the image (since it's a reverse-depend of rvest?).

cboettig commented 6 years ago

@srs70187 ah, thanks for the follow-up. That's pretty strange; I can replicate what you see, but I don't understand why just doing install.packages('selectr') would fix it since that's effectively how it should have been installed when the image was built in the first place. But I do see that it does fix it.

I would have figured it was a version thing (i.e. the image getting an older version of xml2 or selectr than it actually needed for rvest), but it happens on the older images too.

stevedoor commented 6 years ago

@cboettig @eddelbuettel

Could this be the issue?

cboettig commented 6 years ago

@srs70187 No, I think the stackoverflow post is wrong that this is somehow a debian apt problem. As we just confirmed above, this problem happens when we install all the packages from source, as we do on the tidyverse image. No R packages are being installed from debian repos, so they cannot be at fault.

but I'm at a loss how to explain that simply re-installing selectr in essentially the same way it was already installed on the image (i.e. the same version, and built from source) could somehow magically fix things. but it does!

eddelbuettel commented 6 years ago

@srs70187 No, don't think so as we don't use those repos as far as I know.

I usually dive into the container and look at AP <- available.packages() to see what it sees but I have been to tied up. At the end of the day something must be pointing somewhere else...