martin-borkovec / ggparty

147 stars 14 forks source link

Make sure R CMD check runs without warnings #3

Closed HeidiSeibold closed 5 years ago

HeidiSeibold commented 5 years ago

I currently get:

$ R CMD build .
* checking for file ‘./DESCRIPTION’ ... OK
* preparing ‘ggparty’:
* checking DESCRIPTION meta-information ... OK
* checking for LF line-endings in source and make files and shell scripts
* checking for empty or unneeded directories
* building ‘ggparty_0.0.0.9000.tar.gz’

$ R CMD check ggparty_0.0.0.9000.tar.gz 
* using log directory ‘/home/hseibold/Documents/git/ggparty/ggparty.Rcheck’
* using R version 3.5.1 (2018-07-02)
* using platform: x86_64-pc-linux-gnu (64-bit)
* using session charset: UTF-8
* checking for file ‘ggparty/DESCRIPTION’ ... OK
* this is package ‘ggparty’ version ‘0.0.0.9000’
* package encoding: UTF-8
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for executable files ... OK
* checking for hidden files and directories ... NOTE
Found the following hidden files and directories:
  .travis.yml
These were most likely included in error. See section ‘Package
structure’ in the ‘Writing R Extensions’ manual.
* checking for portable file names ... WARNING
Found the following files with non-portable file names:
  project description.pdf
  R/example code.R
  useful links.txt
These are not fully portable file names.
See section ‘Package structure’ in the ‘Writing R Extensions’ manual.
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘ggparty’ can be installed ... ERROR
Installation failed.
See ‘/home/hseibold/Documents/git/ggparty/ggparty.Rcheck/00install.out’ for details.
* DONE

Status: 1 ERROR, 1 WARNING, 1 NOTE
See
  ‘/home/hseibold/Documents/git/ggparty/ggparty.Rcheck/00check.log’
for details.

Please let me know if you need any help.

HeidiSeibold commented 5 years ago

This will also make $ R CMD INSTALL ggparty_0.0.0.9000.tar.gz work.

HeidiSeibold commented 5 years ago

Most current problems are due to problematic files or file names.

Tipps:

Niyazu commented 5 years ago

Thanks for the tips! The problems caused by the files were cleared up. Running the test_that commands interactively seems to work, however, the command "devtools::check()" still throws an error for me, which I don't understand. The error states that there is no package called "partykit", even though I installed and loaded it. Here is what I get:

`> devtools::check() -- Building --------------------------------------------------------- ggparty -- Setting env vars:

-- Checking --------------------------------------------------------- ggparty -- Setting env vars:

-- R CMD check results ---------------------------------------------------------------------------------------------- ggparty 0.0.0.9000 ---- Duration: 1.8s

checking whether package 'ggparty' can be installed ... ERROR See below...

-- Install failure --------------------------------------------------------------------------------------------------------------------------

1 error x | 0 warnings √ | 0 notes √`

HeidiSeibold commented 5 years ago

Your package can't be installed. Please first make sure your package can be installed usign R CMD INSTALL package.tar.gz after running R CMD build package and/or devtools::install().

When I install the package (master branch) it seems to run R code, which it usually should not do:

00install.out ``` * installing *source* package ‘ggparty’ ... ** R ** byte-compile and prepare package for lazy loading List of 8 $ 1:Class 'party' hidden list of 6 ..$ node :List of 3 .. ..$ id :List of 2 .. .. ..$ id : Named list() .. .. .. ..- attr(*, "class")= chr "partynode" .. .. ..$ split : Named list() .. .. .. ..- attr(*, "class")= chr "partynode" .. .. ..- attr(*, "class")= chr "partynode" .. ..$ split : Named list() .. .. ..- attr(*, "class")= chr "partynode" .. ..$ kids :List of 2 .. .. ..$ id : Named list() .. .. .. ..- attr(*, "class")= chr "partynode" .. .. ..$ split : Named list() .. .. .. ..- attr(*, "class")= chr "partynode" .. .. ..- attr(*, "class")= chr "partynode" .. ..- attr(*, "class")= chr "partynode" ..$ data :'data.frame': 14 obs. of 5 variables: .. ..$ outlook : Factor w/ 3 levels "sunny","overcast",..: 1 1 2 3 3 3 2 1 1 3 ... .. ..$ temperature: num [1:14] 85 80 83 70 68 65 64 72 69 75 ... .. ..$ humidity : num [1:14] 85 90 86 96 80 70 65 95 70 80 ... .. ..$ windy : Factor w/ 2 levels "false","true": 1 2 1 1 1 2 2 1 1 1 ... .. ..$ play : Factor w/ 2 levels "yes","no": 2 2 1 1 1 2 1 2 1 1 ... ..$ fitted:'data.frame': 14 obs. of 1 variable: .. ..$ (fitted): int [1:14] 4 4 5 7 7 8 5 4 3 7 ... ..$ terms : NULL ..$ names : chr [1:8] "1" "2" "3" "4" ... ..$ info : NULL $ 2:Class 'party' hidden list of 6 ..$ node :List of 2 .. ..$ id : Named list() .. .. ..- attr(*, "class")= chr "partynode" .. ..$ split : Named list() .. .. ..- attr(*, "class")= chr "partynode" .. ..- attr(*, "class")= chr "partynode" ..$ data :'data.frame': 5 obs. of 5 variables: .. ..$ outlook : Factor w/ 3 levels "sunny","overcast",..: 1 1 1 1 1 .. ..$ temperature: num [1:5] 85 80 72 69 75 .. ..$ humidity : num [1:5] 85 90 95 70 70 .. ..$ windy : Factor w/ 2 levels "false","true": 1 2 1 1 2 .. ..$ play : Factor w/ 2 levels "yes","no": 2 2 2 1 1 ..$ fitted:'data.frame': 5 obs. of 1 variable: .. ..$ (fitted): int [1:5] 3 3 3 2 2 ..$ terms : NULL ..$ names : chr [1:3] "2" "3" "4" ..$ info : NULL $ 3:Class 'party' hidden list of 6 ..$ node : Named list() .. ..- attr(*, "class")= chr "partynode" ..$ data :'data.frame': 2 obs. of 5 variables: .. ..$ outlook : Factor w/ 3 levels "sunny","overcast",..: 1 1 .. ..$ temperature: num [1:2] 69 75 .. ..$ humidity : num [1:2] 70 70 .. ..$ windy : Factor w/ 2 levels "false","true": 1 2 .. ..$ play : Factor w/ 2 levels "yes","no": 1 1 ..$ fitted:'data.frame': 2 obs. of 1 variable: .. ..$ (fitted): int [1:2] 1 1 ..$ terms : NULL ..$ names : chr "3" ..$ info : NULL $ 4:Class 'party' hidden list of 6 ..$ node : Named list() .. ..- attr(*, "class")= chr "partynode" ..$ data :'data.frame': 3 obs. of 5 variables: .. ..$ outlook : Factor w/ 3 levels "sunny","overcast",..: 1 1 1 .. ..$ temperature: num [1:3] 85 80 72 .. ..$ humidity : num [1:3] 85 90 95 .. ..$ windy : Factor w/ 2 levels "false","true": 1 2 1 .. ..$ play : Factor w/ 2 levels "yes","no": 2 2 2 ..$ fitted:'data.frame': 3 obs. of 1 variable: .. ..$ (fitted): int [1:3] 1 1 1 ..$ terms : NULL ..$ names : chr "4" ..$ info : NULL $ 5:Class 'party' hidden list of 6 ..$ node : Named list() .. ..- attr(*, "class")= chr "partynode" ..$ data :'data.frame': 4 obs. of 5 variables: .. ..$ outlook : Factor w/ 3 levels "sunny","overcast",..: 2 2 2 2 .. ..$ temperature: num [1:4] 83 64 72 81 .. ..$ humidity : num [1:4] 86 65 90 75 .. ..$ windy : Factor w/ 2 levels "false","true": 1 2 2 1 .. ..$ play : Factor w/ 2 levels "yes","no": 1 1 1 1 ..$ fitted:'data.frame': 4 obs. of 1 variable: .. ..$ (fitted): int [1:4] 1 1 1 1 ..$ terms : NULL ..$ names : chr "5" ..$ info : NULL $ 6:Class 'party' hidden list of 6 ..$ node :List of 2 .. ..$ id : Named list() .. .. ..- attr(*, "class")= chr "partynode" .. ..$ split : Named list() .. .. ..- attr(*, "class")= chr "partynode" .. ..- attr(*, "class")= chr "partynode" ..$ data :'data.frame': 5 obs. of 5 variables: .. ..$ outlook : Factor w/ 3 levels "sunny","overcast",..: 3 3 3 3 3 .. ..$ temperature: num [1:5] 70 68 65 75 71 .. ..$ humidity : num [1:5] 96 80 70 80 91 .. ..$ windy : Factor w/ 2 levels "false","true": 1 1 2 1 2 .. ..$ play : Factor w/ 2 levels "yes","no": 1 1 2 1 2 ..$ fitted:'data.frame': 5 obs. of 1 variable: .. ..$ (fitted): int [1:5] 2 2 3 2 3 ..$ terms : NULL ..$ names : chr [1:3] "6" "7" "8" ..$ info : NULL $ 7:Class 'party' hidden list of 6 ..$ node : Named list() .. ..- attr(*, "class")= chr "partynode" ..$ data :'data.frame': 3 obs. of 5 variables: .. ..$ outlook : Factor w/ 3 levels "sunny","overcast",..: 3 3 3 .. ..$ temperature: num [1:3] 70 68 75 .. ..$ humidity : num [1:3] 96 80 80 .. ..$ windy : Factor w/ 2 levels "false","true": 1 1 1 .. ..$ play : Factor w/ 2 levels "yes","no": 1 1 1 ..$ fitted:'data.frame': 3 obs. of 1 variable: .. ..$ (fitted): int [1:3] 1 1 1 ..$ terms : NULL ..$ names : chr "7" ..$ info : NULL $ 8:Class 'party' hidden list of 6 ..$ node : Named list() .. ..- attr(*, "class")= chr "partynode" ..$ data :'data.frame': 2 obs. of 5 variables: .. ..$ outlook : Factor w/ 3 levels "sunny","overcast",..: 3 3 .. ..$ temperature: num [1:2] 65 71 .. ..$ humidity : num [1:2] 70 91 .. ..$ windy : Factor w/ 2 levels "false","true": 2 2 .. ..$ play : Factor w/ 2 levels "yes","no": 2 2 ..$ fitted:'data.frame': 2 obs. of 1 variable: .. ..$ (fitted): int [1:2] 1 1 ..$ terms : NULL ..$ names : chr "8" ..$ info : NULL - attr(*, "class")= chr "party" Error in info_node(node) : object 'py' not found Error : unable to load R code in package ‘ggparty’ ERROR: lazy loading failed for package ‘ggparty’ * removing ‘/home/hseibold/Documents/git/ggparty/ggparty.Rcheck/ggparty’ ```

A solution is to store code that just shows how the package works in folder inst instead of R (I think the problem is https://github.com/mmostly-harmless/ggparty/blob/master/R/presentation.R)

HeidiSeibold commented 5 years ago

Also your DESCRIPTION file needs to specify that partykit and ggplot2 are dependencies.

For more infos see https://cran.r-project.org/doc/manuals/r-release/R-exts.html#The-DESCRIPTION-file