Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix DataStore/Power BI integration #47

Merged
merged 6 commits into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ dataPackages/*
data/raw/*
data/raw/*/*
inst/doc
data/
14 changes: 10 additions & 4 deletions R/EML_to_dataframe.R → R/load_EML_df.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,18 @@
#' df <- load_EML_df(1234567)
#' }
#'
load_EML_df <- function(ds_ref, directory = here::here("data")){
load_EML_df <- function(ds_ref, path = paste0(getwd(), "/data")){
#construct path to downloaded data package:
path <- here::here(directory, ds_ref)
#capture current/original working directory:
origin_wd <- getwd()
#set directory back to original working directory on exit.
on.exit(setwd(origin_wd), add=TRUE)

setwd(path)
directory <- paste0(path, "/", ds_ref)

#load metadata
metadata <- DPchecker::load_metadata(directory = path)
metadata <- DPchecker::load_metadata(directory = directory)

title <- EMLeditor::get_title(metadata)
pub_date <- metadata$dataset$pubDate
Expand Down Expand Up @@ -65,7 +71,7 @@ load_EML_df <- function(ds_ref, directory = here::here("data")){
license_name <- metadata$dataset$licensed$licenseName

#get files lists:
files <- list.files(path=path, pattern = "*.csv")
files <- list.files(path=directory, pattern = "*.csv")
file_names <- data.frame(files, files)
file_names$eml_element <- "data_file"
file_names <- file_names[,c(3,1,2)]
Expand Down
2 changes: 1 addition & 1 deletion docs/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ pkgdown: 2.0.7
pkgdown_sha: ~
articles:
NPSutils: NPSutils.html
last_built: 2023-12-04T18:45Z
last_built: 2023-12-07T16:11Z

2 changes: 1 addition & 1 deletion docs/reference/dot-get_authors.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/dot-get_contacts.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/reference/load_EML_df.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/dot-get_authors.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/dot-get_contacts.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/load_EML_df.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.