Skip to content

Commit

Permalink
issues #5 and #6
Browse files Browse the repository at this point in the history
  • Loading branch information
ake123 committed Nov 13, 2024
1 parent a0004d0 commit b0d56ec
Show file tree
Hide file tree
Showing 20 changed files with 40 additions and 83 deletions.
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export(enrich_author_name)
export(finna_cite)
export(finna_interactive)
export(get_finna_records)
export(integrate_metadata)
export(load_offline_data)
export(refine_metadata)
export(save_for_offline)
Expand Down
File renamed without changes.
28 changes: 0 additions & 28 deletions R/integrateFinna.R

This file was deleted.

3 changes: 3 additions & 0 deletions R/refinemetaData.R → R/refine_metadata.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#' Refine Finna Metadata
#'
#' Refines the Finna metadata tibble by keeping relevant fields and cleaning up missing values.
#' The purpose of the refine_metadata function is to: Ensure completeness by filling in missing
#' values with placeholder text, Standardize key metadata fields for easier analysis, Select only
#' the most relevant fields, simplifying the dataset.
#'
#' @param data A tibble containing raw Finna metadata.
#' @return A tibble with selected, cleaned metadata fields, or NULL if required fields are missing.
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion man/analyze_metadata.Rd

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

35 changes: 0 additions & 35 deletions man/integrate_metadata.Rd

This file was deleted.

5 changes: 4 additions & 1 deletion man/refine_metadata.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/visualize_author_distribution.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/visualize_format_distribution.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/visualize_format_distribution_pie.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/visualize_format_library_correlation.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/visualize_library_distribution.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/visualize_subject_distribution.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/visualize_title_year_heatmap.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/visualize_top_20_titles.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/visualize_word_cloud.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/visualize_year_distribution.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/visualize_year_distribution_line.Rd

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

27 changes: 21 additions & 6 deletions vignettes/articles/refinemetadata.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,14 @@ vignette: >

# Introduction

This vignette provides an overview of how to use the finna package.
The purpose of the ` refine_metadata()` function is to:

- **Ensure completeness** by filling in missing values with placeholder text.
- **Standardize key metadata fields** for easier analysis.
- **Select only the most relevant fields**, simplifying the dataset.

This refinement process makes the metadata more consistent and user-friendly, reducing potential issues in subsequent analysis or reporting.

### **Refine using ` refine_metadata()` function**

```{r}
library(finna)
Expand All @@ -20,17 +25,27 @@ refined_data <- refine_metadata(sibelius_data)
print(refined_data)
```

### **integrate using ` integrate_metadata()` Function**
### **integrate to other metadata **
To integrate two datasets using full_join() from dplyr, you can write the code directly like this:

```{r message = FALSE, warning = FALSE}
library(dplyr)
```{r}
finna_data <- search_finna("sibelius")
# Example Finna metadata (metadata1)
finna_data <- search_finna("sibelius",limit = 4)
# Example other dataset to merge with (metadata2)
other_data <- tibble::tibble(
Title = c("Sibelius Symphony No. 5", "Finlandia", "Valse Triste"),
Rating = c(5, 4, 3)
)
integrated_data <- integrate_metadata(finna_data, other_data, key = "Title")
# Integrate the two datasets using full_join by the "Title" column
integrated_data <- full_join(finna_data, other_data, by = "Title")
# Print the integrated dataset
print(integrated_data)
```


Expand Down

0 comments on commit b0d56ec

Please sign in to comment.