Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2f43cfe

Browse files
committed
path fix
1 parent08cbfab commit2f43cfe

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

‎R/pfw_sitedata.R‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#' the designated path or "data-raw" if no path is selected.
77
#'
88
#' @param data A Project FeederWatch dataset.
9-
#' @param path File path to the site description .csv from https://feederwatch.org/explore/raw-dataset-requests/. If not specified, defaults to "data-raw/site_data.csv".
9+
#' @param path File path to the site description .csv from https://feederwatch.org/explore/raw-dataset-requests/. If not specified, defaults to "data-raw/sitedata.csv".
1010
#'
1111
#' @return The original dataset with site metadata merged in.
1212
#'
@@ -20,7 +20,7 @@
2020
#' @export
2121
pfw_sitedata<-function(data,path) {
2222
if (missing(path)|| is.null(path)) {
23-
path<- file.path(tools::R_user_dir("PFW","data"),"data-raw","site_data.csv")
23+
path<- file.path(tools::R_user_dir("PFW","data"),"data-raw","sitedata.csv")
2424
}
2525

2626
# Download site data if path doesn't exist
@@ -47,9 +47,11 @@ pfw_sitedata <- function(data, path) {
4747

4848
# Construct full URL
4949
site_url<-hrefs[[1]]
50+
filename<- basename(site_url)
5051
if (!grepl("^http",site_url)) {
5152
site_url<- paste0("https://feederwatch.org",site_url)
5253
}
54+
path<- file.path(dirname(path),filename)
5355
message("Site metadata not found at provided path. Downloading from FeederWatch...")
5456

5557
tryCatch(

‎man/pfw_sitedata.Rd‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp