ropensci / popler

The R package to browse and query the popler database
https://docs.ropensci.org/popler
MIT License
8 stars 7 forks source link

use of 'possibleargs' and 'main_popler' in browse() are unsafe #20

Closed bochocki closed 7 years ago

bochocki commented 7 years ago

These variables in the browse() function should probably be specified in a safer way. As it currently stands, a user could easily (and unintentionally) overwrite possibleargs or main_popler and the whole package would stop working.

Consider changing these to functions that return outputs. For example, instead of:

possibleargs <- c("A","B","C")

use


possibleargs = function(){ return(c("A","B","C")) }
bochocki commented 7 years ago

I made a function possible_args() that returns a vector of possible arguments.

I also made a function called 'main_table()' that "loads" main_popler and does the basic manipulations that were at the head of browse(). So the problem with main_popler is just moved for now... if somebody overwrites main_popler the browse function will stop working. This should probably be fixed.

both functions are in browse.R

bochocki commented 7 years ago

Closing this argument since it has converged with https://github.com/AldoCompagnoni/popler/issues/27