Matthieu S
2017-Mar-22 18:54 UTC
[R-sig-Debian] Package selectr: issue with the apt-get version, but not with the one installed from R?
Hi I am facing an issue with the package selectr, where I get an error trying to run an example code: css_to_xpath(".testclass"), gives could not find function "xpath_class" The issue arises however only with the package installed with apt-get, not when installed from within R. I got a similar issue with maptools, where I was not able to use data(wrld_map), and switching to the version "from within R" version did solve the issue in the same way. Note that I posted the issue some time ago on stack-overflow: http://stackoverflow.com/questions/40874011/r-rvest-could-not-find-function-xpath-element/42960170#42960170 but now that I pinned the issue down to the apt-get versus R, I hope I can ask on this list? For the apt-get, I have cran sources added, as well as Michael's ppa http://ppa.launchpad.net/marutter/rrutter/ubuntu and http://ppa.launchpad.net/marutter/c2d4u/ubuntu Here is a sample code showing my issue:> pkg <- installed.packages() > subset(as.data.frame(pkg), Package=="selectr", c("Package", "LibPath"))Package LibPath selectr selectr /home/matifou/R/x86_64-pc-linux-gnu-library/3.3 selectr.1 selectr /usr/lib/R/site-library> library(selectr,lib.loc="/home/matifou/R/x86_64-pc-linux-gnu-library/3.3")> css_to_xpath(".testclass")[1] "descendant-or-self::*[@class and contains(concat(' ', normalize-space(@class), ' '), ' testclass ')]"> detach("package:selectr", unload=TRUE) > library(selectr, lib.loc="/usr/lib/R/site-library") > css_to_xpath(".testclass")Error in do.call(method, list(parsed_selector)) : could not find function "xpath_class" Thanks!! Matthieu [[alternative HTML version deleted]]
Michael Rutter
2017-Mar-22 23:48 UTC
[R-sig-Debian] Package selectr: issue with the apt-get version, but not with the one installed from R?
On 03/22/2017 02:54 PM, Matthieu S wrote:> Hi > > I am facing an issue with the package selectr, where I get an error trying > to run an example code: css_to_xpath(".testclass"), gives could not find > function "xpath_class" > > The issue arises however only with the package installed with apt-get, not > when installed from within R. I got a similar issue with maptools, where I > was not able to use data(wrld_map), and switching to the version "from > within R" version did solve the issue in the same way. > > Note that I posted the issue some time ago on stack-overflow: > http://stackoverflow.com/questions/40874011/r-rvest-could-not-find-function-xpath-element/42960170#42960170 > but now that I pinned the issue down to the apt-get versus R, I hope I can > ask on this list? For the apt-get, I have cran sources added, as well as > Michael's ppa http://ppa.launchpad.net/marutter/rrutter/ubuntu and > http://ppa.launchpad.net/marutter/c2d4u/ubuntuMatthieu, I am able to recreate this, but I am not sure what the solution is. I am going to try a couple of things and let you know. The code for "xpath_class" is there, it is just not finding it. Thanks for pointing this out, Michael> > Here is a sample code showing my issue: > >> pkg <- installed.packages() >> subset(as.data.frame(pkg), Package=="selectr", c("Package", "LibPath")) > Package LibPath > selectr selectr /home/matifou/R/x86_64-pc-linux-gnu-library/3.3 > selectr.1 selectr /usr/lib/R/site-library >> library(selectr, > lib.loc="/home/matifou/R/x86_64-pc-linux-gnu-library/3.3") >> css_to_xpath(".testclass") > [1] "descendant-or-self::*[@class and contains(concat(' ', > normalize-space(@class), ' '), ' testclass ')]" >> detach("package:selectr", unload=TRUE) >> library(selectr, lib.loc="/usr/lib/R/site-library") >> css_to_xpath(".testclass") > Error in do.call(method, list(parsed_selector)) : > could not find function "xpath_class" > > Thanks!! > > Matthieu > > [[alternative HTML version deleted]] > > _______________________________________________ > R-SIG-Debian mailing list > R-SIG-Debian at r-project.org > https://stat.ethz.ch/mailman/listinfo/r-sig-debian >
Michael Rutter
2017-Mar-23 00:41 UTC
[R-sig-Debian] Package selectr: issue with the apt-get version, but not with the one installed from R?
On 03/22/2017 02:54 PM, Matthieu S wrote:> Hi > > I am facing an issue with the package selectr, where I get an error trying > to run an example code: css_to_xpath(".testclass"), gives could not find > function "xpath_class" > > The issue arises however only with the package installed with apt-get, not > when installed from within R. I got a similar issue with maptools, where I > was not able to use data(wrld_map), and switching to the version "from > within R" version did solve the issue in the same way. > > Note that I posted the issue some time ago on stack-overflow: > http://stackoverflow.com/questions/40874011/r-rvest-could-not-find-function-xpath-element/42960170#42960170 > but now that I pinned the issue down to the apt-get versus R, I hope I can > ask on this list? For the apt-get, I have cran sources added, as well as > Michael's ppa http://ppa.launchpad.net/marutter/rrutter/ubuntu and > http://ppa.launchpad.net/marutter/c2d4u/ubuntu >Matthieu, A new version of r-cran-selectr is on the PPA. I think it fixes the issue you had. Not sure if it is correct, but I am getting a different result that does not appear to be an error. Turns out that there is a dependency on codetools that is not listed on CRAN. This is why your local version (which likely has codetools installed) worked and not the one built on the PPA. But that has been fixed, and will be for all future versions. Michael
Apparently Analagous Threads
- Ubuntu 18.04 bionic: availability of R Ubuntu packages/ppa?
- How to install Tidyverse on Ubuntu 17.04? Getting gcc errors for -fstack-protector-strong and -Wdate-time
- [LLVMdev] For a small help
- [LLVMdev] For a small help
- Simple class with an automatic printing issue