Closed peterdesmet closed 2 years ago
I will. Although this is not something specific of camtrap-dp 0.1.6 I think it's still useful to get it done while working on such update.
The problem is due to file.path(path, "datapackage.json")
in read_camtrap_dp()
function (L45):
# read files
package <- read_package(file.path(path, "datapackage.json"))
Possible solutions:
path
arg points to the path of datapackage.json
instead of the folder containing it. Maybe change the name of the arg, from path to file (making path
deprecated and pointing to file
) as this is the name of the argument in datapackage::read_package
? This would make camtrap_dp very similar to the underlying package datapackage
path
starts with http
then package <- read_package(path)
. Other ways to detect automatically that path
is an URL instead of a file path?url
to the function: default FALSE. If FALSE read_package(file.path(path, "datapackage.json"))
, if TRUE: package <- read_package(path)
I vote for the first solution 😄 @peterdesmet, @jimcasaer : which one do you vote for?
Yes, option 1: make new parameter file
. deprecate path
, but keep its current behaviour to append with datapackage.json
.
datapackage
supports reading from URL. It would be nice if this is supported byread_camtrap_dp()
as well.