From f82723258212bfd220fea7c73fad370198b351ae Mon Sep 17 00:00:00 2001 From: iquevedo123 Date: Thu, 25 Apr 2024 16:35:34 -0600 Subject: [PATCH 1/9] Created .R file for new function and added initial documentation --- R/get_columns_from_files.R | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 R/get_columns_from_files.R diff --git a/R/get_columns_from_files.R b/R/get_columns_from_files.R new file mode 100644 index 0000000..35cc0b6 --- /dev/null +++ b/R/get_columns_from_files.R @@ -0,0 +1,7 @@ +#' Get all columns from each csv and columns that occur more than once across those csv's +#' +#' @description `get_columns_from_files()` produces two dataframes: one that lists all columns from within each of the .csv's in a specified working directory and another that lists all columns which appear more than once across those .csv's +#' +#' @details `get_columns_from_files()` can be used as an intitial step in data processing, particularly if the goal of the data processing is to merge multiple files into one, larger flat file. The function allows the user to preview and list out what columns exist within any given number of .csv's in a format that is more digestible. If the user chooses, they can also find commonalities across the columns in those files, highlighting any columns that serve as key variables upon which dataframes can then be joined. +#' +#' \ No newline at end of file From a492acd5db5237bace05123ee277919d9759dcbb Mon Sep 17 00:00:00 2001 From: iquevedo123 Date: Wed, 29 May 2024 14:33:47 -0600 Subject: [PATCH 2/9] Rewrite descriptions and add in function code --- R/get_columns_from_files.R | 67 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 64 insertions(+), 3 deletions(-) diff --git a/R/get_columns_from_files.R b/R/get_columns_from_files.R index 35cc0b6..f33bd2e 100644 --- a/R/get_columns_from_files.R +++ b/R/get_columns_from_files.R @@ -1,7 +1,68 @@ -#' Get all columns from each csv and columns that occur more than once across those csv's +#' Retrieve all columns from each dataset and columns that occur more than once across those datasets #' #' @description `get_columns_from_files()` produces two dataframes: one that lists all columns from within each of the .csv's in a specified working directory and another that lists all columns which appear more than once across those .csv's #' -#' @details `get_columns_from_files()` can be used as an intitial step in data processing, particularly if the goal of the data processing is to merge multiple files into one, larger flat file. The function allows the user to preview and list out what columns exist within any given number of .csv's in a format that is more digestible. If the user chooses, they can also find commonalities across the columns in those files, highlighting any columns that serve as key variables upon which dataframes can then be joined. +#' @details `get_columns_from_files()` can be used as an initial step in data processing, particularly if the goal of the data processing is to merge multiple files into one, larger flat file. The function allows the user to preview and list out what columns exist within any given number of .csv's in a format that is more digestible. If the user chooses, they can also find commonalities across the columns in those files, highlighting any columns that serve as key variables upon which dataframes can then be joined. #' -#' \ No newline at end of file +#'@param wd +#' +get_columns_from_files <- function(wd = getwd(), common = FALSE){ + +fileList <- list.files(path = wd, pattern = "\\.csv$") # create a list with the names of all csv's + +dfList <- suppressMessages(lapply(fileList, readr::read_csv)) # create a nested list of all datasets + +names(dfList) <- fileList # name each list within dfList by the name of it's respective file name + +maxCols <- list() # create an empty list to find the max number of columns from the provided datasets + +for(i in 1:max(length(dfList))){ + maxCols[i] <- length(names(dfList[[i]])) +} # fill in the list with the number of columns from each dataset + +maxCols <- max(unlist(maxCols)) # find the max column number from the list + +allCols <- tibble::tibble(.rows = maxCols) # create an empty dataframe with the maximum number of rows being the maximum number of columns from the datasets provided + +for(i in 1:max(length(dfList))){ + + columns <- names(dfList[[i]]) + + length(columns) <- maxCols + + tempdf <- tibble::tibble(columns) + names(tempdf)[1] <- names(dfList)[i] + + allCols <- cbind(allCols, tempdf) + +} # add a list of all columns from each provided dataset to the empty dataframe + +df <- unlist(allCols) + +y <- list() +z <- list() + + +for(i in 1:length(df)){ + y[i] <- length(which(df == df[i])) +} # find how many times a value within the column names is repeated. Generates a list with the number of times each respective column name is repeated across all column names + + +for(i in 1:length(y)){ + ifelse( + y[i] > 1, + z[i] <- df[i], + next) +} # if a column name appears more than once across all column names, capture that column in a list (z) + +z <- Filter(Negate(is.null), z) # get rid of Null values +commonCols <- z %>% unique() %>% tibble::tibble() # Filter to a unique list of the column names that appear more than once +colnames(commonCols)[1] <- "Common Columns" + +ifelse(common == FALSE, + return(allCols), + return(commonCols) +) + + +} \ No newline at end of file From 906777a7167c116f3ddbfa7d4c20eab4be4830a8 Mon Sep 17 00:00:00 2001 From: iquevedo123 Date: Wed, 29 May 2024 15:42:50 -0600 Subject: [PATCH 3/9] Add in and format roxygen documentation --- R/get_columns_from_files.R | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/R/get_columns_from_files.R b/R/get_columns_from_files.R index f33bd2e..6497f4f 100644 --- a/R/get_columns_from_files.R +++ b/R/get_columns_from_files.R @@ -4,7 +4,18 @@ #' #' @details `get_columns_from_files()` can be used as an initial step in data processing, particularly if the goal of the data processing is to merge multiple files into one, larger flat file. The function allows the user to preview and list out what columns exist within any given number of .csv's in a format that is more digestible. If the user chooses, they can also find commonalities across the columns in those files, highlighting any columns that serve as key variables upon which dataframes can then be joined. #' -#'@param wd +#'@param wd String. Your specified working directory; points to the directory where the .csv files you want to work with live. I.e., "getwd()", "setwd("./data examples")" +#' +#'@param common Logical. Defaults to FALSE. In default status, the function returns a full dataframe of all columns within each of the files in your working directory. If set to TRUE, the function returns a single list of columns that occur more than once across all of your files. +#' +#'@return one of two dataframes. If common set to FALSE, returns a dataframe of all columns in the files within your working directory. If common set to TRUE, returns a list of common columns across your files. +#' +#'@export +#' +#'@examples +#' \dontrun{ +#' get_columns_from_files(wd = setwd("./data examples"), common = TRUE) +#' } #' get_columns_from_files <- function(wd = getwd(), common = FALSE){ From e494853cb65eaea3a7ed1827c5decf3f0b5f9199 Mon Sep 17 00:00:00 2001 From: iquevedo123 Date: Wed, 29 May 2024 15:43:48 -0600 Subject: [PATCH 4/9] Proper formatting of documentation as is recommended in the tidyverse style guide --- R/get_columns_from_files.R | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/R/get_columns_from_files.R b/R/get_columns_from_files.R index 6497f4f..64ff348 100644 --- a/R/get_columns_from_files.R +++ b/R/get_columns_from_files.R @@ -1,18 +1,18 @@ #' Retrieve all columns from each dataset and columns that occur more than once across those datasets #' -#' @description `get_columns_from_files()` produces two dataframes: one that lists all columns from within each of the .csv's in a specified working directory and another that lists all columns which appear more than once across those .csv's +#' @description `get_columns_from_files()` produces two dataframes: one that lists all columns from within each of the .csv's in a specified working directory and another that lists all columns which appear more than once across those .csv's. #' -#' @details `get_columns_from_files()` can be used as an initial step in data processing, particularly if the goal of the data processing is to merge multiple files into one, larger flat file. The function allows the user to preview and list out what columns exist within any given number of .csv's in a format that is more digestible. If the user chooses, they can also find commonalities across the columns in those files, highlighting any columns that serve as key variables upon which dataframes can then be joined. +#' @details `get_columns_from_files()` can be used as an initial step in data processing, particularly if the goal of the data processing is to merge multiple files into one, larger flat file. The function allows the user to preview and list out what columns exist within any given number of .csv's in a format that is more digestible. If the user chooses, they can also find commonalities across the columns in those files, highlighting any columns that serve as key variables upon which dataframes can then be joined. #' -#'@param wd String. Your specified working directory; points to the directory where the .csv files you want to work with live. I.e., "getwd()", "setwd("./data examples")" +#' @param wd String. Your specified working directory; points to the directory where the .csv files you want to work with live. I.e., `getwd()`, `setwd("./data examples")`. #' -#'@param common Logical. Defaults to FALSE. In default status, the function returns a full dataframe of all columns within each of the files in your working directory. If set to TRUE, the function returns a single list of columns that occur more than once across all of your files. +#' @param common Logical. Defaults to `FALSE`. In default status, the function returns a full dataframe of all columns within each of the files in your working directory. If set to `TRUE`, the function returns a single list of columns that occur more than once across all of your files. #' -#'@return one of two dataframes. If common set to FALSE, returns a dataframe of all columns in the files within your working directory. If common set to TRUE, returns a list of common columns across your files. +#' @return one of two dataframes. If common set to `FALSE`, returns a dataframe of all columns in the files within your working directory. If common set to `TRUE`, returns a list of common columns across your files. #' -#'@export +#' @export #' -#'@examples +#' @examples #' \dontrun{ #' get_columns_from_files(wd = setwd("./data examples"), common = TRUE) #' } From e73d14220222aca5ce010d3f336209599509a8d2 Mon Sep 17 00:00:00 2001 From: iquevedo123 Date: Wed, 29 May 2024 15:48:35 -0600 Subject: [PATCH 5/9] added function to namespace and updated .rd --- NAMESPACE | 1 + man/get_columns_from_files.Rd | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 man/get_columns_from_files.Rd diff --git a/NAMESPACE b/NAMESPACE index 61de488..74752ad 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -10,6 +10,7 @@ export(create_datastore_script) export(fix_utc_offset) export(fuzz_location) export(generate_ll_from_utm) +export(get_columns_from_files) export(get_custom_flags) export(get_dc_flags) export(get_df_flags) diff --git a/man/get_columns_from_files.Rd b/man/get_columns_from_files.Rd new file mode 100644 index 0000000..0356358 --- /dev/null +++ b/man/get_columns_from_files.Rd @@ -0,0 +1,28 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/get_columns_from_files.R +\name{get_columns_from_files} +\alias{get_columns_from_files} +\title{Retrieve all columns from each dataset and columns that occur more than once across those datasets} +\usage{ +get_columns_from_files(wd = getwd(), common = FALSE) +} +\arguments{ +\item{wd}{String. Your specified working directory; points to the directory where the .csv files you want to work with live. I.e., \code{getwd()}, \code{setwd("./data examples")}.} + +\item{common}{Logical. Defaults to \code{FALSE}. In default status, the function returns a full dataframe of all columns within each of the files in your working directory. If set to \code{TRUE}, the function returns a single list of columns that occur more than once across all of your files.} +} +\value{ +one of two dataframes. If common set to \code{FALSE}, returns a dataframe of all columns in the files within your working directory. If common set to \code{TRUE}, returns a list of common columns across your files. +} +\description{ +\code{get_columns_from_files()} produces two dataframes: one that lists all columns from within each of the .csv's in a specified working directory and another that lists all columns which appear more than once across those .csv's. +} +\details{ +\code{get_columns_from_files()} can be used as an initial step in data processing, particularly if the goal of the data processing is to merge multiple files into one, larger flat file. The function allows the user to preview and list out what columns exist within any given number of .csv's in a format that is more digestible. If the user chooses, they can also find commonalities across the columns in those files, highlighting any columns that serve as key variables upon which dataframes can then be joined. +} +\examples{ +\dontrun{ +get_columns_from_files(wd = setwd("./data examples"), common = TRUE) +} + +} From 2f5ce710d7b1ecafc309f48d4e54bf082d701331 Mon Sep 17 00:00:00 2001 From: iquevedo123 Date: Wed, 29 May 2024 15:53:39 -0600 Subject: [PATCH 6/9] Updated Github site and articles --- docs/404.html | 4 +- docs/LICENSE-text.html | 4 +- docs/LICENSE.html | 4 +- docs/articles/DRR_Purpose_and_Scope.html | 10 +- docs/articles/Starting-a-DRR.html | 8 +- docs/articles/Using-the-DRR-Template.html | 8 +- docs/articles/index.html | 4 +- docs/authors.html | 6 +- docs/index.html | 6 +- docs/news/index.html | 4 +- docs/pkgdown.yml | 6 +- docs/reference/DC_col_check.html | 4 +- docs/reference/QCkit-package.html | 4 +- docs/reference/check_dc_cols.html | 4 +- docs/reference/check_te.html | 4 +- docs/reference/convert_datetime_format.html | 4 +- docs/reference/convert_long_to_utm.html | 4 +- docs/reference/convert_utm_to_ll.html | 4 +- docs/reference/create_datastore_script.html | 4 +- docs/reference/dot-get_unit_boundary.html | 4 +- docs/reference/fix_utc_offset.html | 4 +- docs/reference/fuzz_location.html | 4 +- docs/reference/generate_ll_from_utm.html | 4 +- docs/reference/get_columns_from_files.html | 127 ++++++++++++++++++++ docs/reference/get_custom_flags.html | 4 +- docs/reference/get_dc_flags.html | 9 +- docs/reference/get_df_flags.html | 4 +- docs/reference/get_dp_flags.html | 4 +- docs/reference/get_elevation.html | 4 +- docs/reference/get_park_polygon.html | 4 +- docs/reference/get_taxon_rank.html | 4 +- docs/reference/get_utm_zone.html | 4 +- docs/reference/index.html | 8 +- docs/reference/long2UTM.html | 4 +- docs/reference/order_cols.html | 4 +- docs/reference/replace_blanks.html | 4 +- docs/reference/te_check.html | 4 +- docs/reference/utm_to_ll.html | 4 +- docs/reference/validate_coord.html | 4 +- docs/reference/validate_coord_list.html | 4 +- docs/sitemap.xml | 3 + 41 files changed, 223 insertions(+), 92 deletions(-) create mode 100644 docs/reference/get_columns_from_files.html diff --git a/docs/404.html b/docs/404.html index bbe9a71..4210397 100644 --- a/docs/404.html +++ b/docs/404.html @@ -6,7 +6,7 @@ Page not found (404) • QCkit - + @@ -106,7 +106,7 @@

Page not found (404)

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.9.

diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html index b5eec88..b898a65 100644 --- a/docs/LICENSE-text.html +++ b/docs/LICENSE-text.html @@ -1,5 +1,5 @@ -License • QCkitLicense • QCkit @@ -103,7 +103,7 @@

License

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.9.

diff --git a/docs/LICENSE.html b/docs/LICENSE.html index 940cf0b..f686c6b 100644 --- a/docs/LICENSE.html +++ b/docs/LICENSE.html @@ -1,5 +1,5 @@ -CC0 1.0 Universal • QCkitCC0 1.0 Universal • QCkit @@ -112,7 +112,7 @@

Statement of Purpose -

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.9.

diff --git a/docs/articles/DRR_Purpose_and_Scope.html b/docs/articles/DRR_Purpose_and_Scope.html index b45398f..c7246fc 100644 --- a/docs/articles/DRR_Purpose_and_Scope.html +++ b/docs/articles/DRR_Purpose_and_Scope.html @@ -6,7 +6,7 @@ DRR Purpose and Scope • QCkit - + @@ -350,7 +350,7 @@

General Studies +library(NPSdataverse)
 # Alternatively, install and load just QCkit:
 devtools::install_github("nationalparkservice/QCkit")
@@ -180,7 +180,7 @@ 

How to Start a DRR

+

  1. After selecting “OK” two things will happen: First, you the DRR Template file will open up. It is called “Untitled.Rmd” by default. @@ -223,7 +223,7 @@

    Examples

    -

    Site built with pkgdown 2.0.6.

    +

    Site built with pkgdown 2.0.9.

diff --git a/docs/articles/Using-the-DRR-Template.html b/docs/articles/Using-the-DRR-Template.html index 4ce1257..8aece29 100644 --- a/docs/articles/Using-the-DRR-Template.html +++ b/docs/articles/Using-the-DRR-Template.html @@ -6,7 +6,7 @@ Using the DRR Template • QCkit - + @@ -381,13 +381,13 @@
Automating Citations -Adding Citations - Source vs. Visual editing of the Template and how to access the citation manager.

+Adding Citations - Source vs. Visual editing of the Template and how to access the citation manager.

Adding Citations - Source vs. Visual editing of the Template and how to access the citation manager.

-Adding Citations - Using the citation manager.

+Adding Citations - Using the citation manager.

Adding Citations - Using the citation manager.

@@ -662,7 +662,7 @@

Liability Statements

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.9.

diff --git a/docs/articles/index.html b/docs/articles/index.html index dc24a3b..ea5753e 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -1,5 +1,5 @@ -Articles • QCkitArticles • QCkit @@ -82,7 +82,7 @@

All vignettes

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.9.

diff --git a/docs/authors.html b/docs/authors.html index 725329b..0502f2c 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -1,5 +1,5 @@ -Authors and Citation • QCkitAuthors and Citation • QCkit @@ -60,7 +60,7 @@
@@ -120,7 +120,7 @@

Citation

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.9.

diff --git a/docs/index.html b/docs/index.html index 9b95b5d..e5a03b1 100644 --- a/docs/index.html +++ b/docs/index.html @@ -6,7 +6,7 @@ NPS Inventory and Monitoring Quality Control Toolkit • QCkit - + @@ -105,7 +105,7 @@

Installation
 # install.packages("devtools")
 devtools::install_github("nationalparkservice/NPSdataverse")
-library(NPSdataverse)
+library(NPSdataverse)
@@ -166,7 +166,7 @@

Dev status

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.9.

diff --git a/docs/news/index.html b/docs/news/index.html index 1e4b4bc..a0efb0e 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -1,5 +1,5 @@ -Changelog • QCkitChangelog • QCkit @@ -158,7 +158,7 @@

Author

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.9.

diff --git a/docs/reference/check_dc_cols.html b/docs/reference/check_dc_cols.html index 5dc8f2a..127e730 100644 --- a/docs/reference/check_dc_cols.html +++ b/docs/reference/check_dc_cols.html @@ -1,5 +1,5 @@ -TDWG Darwin Core Column Name Check 08-23-2022 — check_dc_cols • QCkitTDWG Darwin Core Column Name Check 08-23-2022 — check_dc_cols • QCkit @@ -109,7 +109,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.9.

diff --git a/docs/reference/check_te.html b/docs/reference/check_te.html index 3a08270..6100fde 100644 --- a/docs/reference/check_te.html +++ b/docs/reference/check_te.html @@ -1,5 +1,5 @@ -Threatened Or Endangered Species Checker Function — check_te • QCkitThreatened Or Endangered Species Checker Function — check_te • QCkit @@ -133,7 +133,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.9.

diff --git a/docs/reference/convert_datetime_format.html b/docs/reference/convert_datetime_format.html index e849325..719f00b 100644 --- a/docs/reference/convert_datetime_format.html +++ b/docs/reference/convert_datetime_format.html @@ -1,5 +1,5 @@ -Convert EML date/time format string to one that R can parse — convert_datetime_format • QCkitConvert EML date/time format string to one that R can parse — convert_datetime_format • QCkit @@ -114,7 +114,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.9.

diff --git a/docs/reference/convert_long_to_utm.html b/docs/reference/convert_long_to_utm.html index 7bead2c..c54c91a 100644 --- a/docs/reference/convert_long_to_utm.html +++ b/docs/reference/convert_long_to_utm.html @@ -1,5 +1,5 @@ -Return UTM Zone — convert_long_to_utm • QCkitReturn UTM Zone — convert_long_to_utm • QCkit -

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.9.

diff --git a/docs/reference/convert_utm_to_ll.html b/docs/reference/convert_utm_to_ll.html index b3c7c33..438023b 100644 --- a/docs/reference/convert_utm_to_ll.html +++ b/docs/reference/convert_utm_to_ll.html @@ -1,5 +1,5 @@ -Coordinate Conversion from UTM to Latitude and Longitude — convert_utm_to_ll • QCkitCoordinate Conversion from UTM to Latitude and Longitude — convert_utm_to_ll • QCkit -

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.9.

diff --git a/docs/reference/create_datastore_script.html b/docs/reference/create_datastore_script.html index 4eabec8..74e4ba3 100644 --- a/docs/reference/create_datastore_script.html +++ b/docs/reference/create_datastore_script.html @@ -1,5 +1,5 @@ -Turn a GitHub release into a DataStore Script Reference — create_datastore_script • QCkitExamples
-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.9.

diff --git a/docs/reference/dot-get_unit_boundary.html b/docs/reference/dot-get_unit_boundary.html index 4433e64..4da3fbc 100644 --- a/docs/reference/dot-get_unit_boundary.html +++ b/docs/reference/dot-get_unit_boundary.html @@ -1,5 +1,5 @@ -Gets NPS unit boundaries from Arc GIS — .get_unit_boundary • QCkitGets NPS unit boundaries from Arc GIS — .get_unit_boundary • QCkit @@ -104,7 +104,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.9.

diff --git a/docs/reference/fix_utc_offset.html b/docs/reference/fix_utc_offset.html index 8cd74fd..dce7455 100644 --- a/docs/reference/fix_utc_offset.html +++ b/docs/reference/fix_utc_offset.html @@ -1,5 +1,5 @@ -Fix UTC offset strings — fix_utc_offset • QCkitFix UTC offset strings — fix_utc_offset • QCkit @@ -108,7 +108,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.9.

diff --git a/docs/reference/fuzz_location.html b/docs/reference/fuzz_location.html index 08ec5de..10732ac 100644 --- a/docs/reference/fuzz_location.html +++ b/docs/reference/fuzz_location.html @@ -1,5 +1,5 @@ -Convert Coordinates Into a Polygon to Obscure Specific Location — fuzz_location • QCkitExamples
-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.9.

diff --git a/docs/reference/generate_ll_from_utm.html b/docs/reference/generate_ll_from_utm.html index bdc21ff..9f71848 100644 --- a/docs/reference/generate_ll_from_utm.html +++ b/docs/reference/generate_ll_from_utm.html @@ -1,5 +1,5 @@ -Coordinate Conversion from UTM to Latitude and Longitude — generate_ll_from_utm • QCkitCoordinate Conversion from UTM to Latitude and Longitude — generate_ll_from_utm • QCkit -

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.9.

diff --git a/docs/reference/get_columns_from_files.html b/docs/reference/get_columns_from_files.html new file mode 100644 index 0000000..6574b05 --- /dev/null +++ b/docs/reference/get_columns_from_files.html @@ -0,0 +1,127 @@ + +Retrieve all columns from each dataset and columns that occur more than once across those datasets — get_columns_from_files • QCkit + + +
+
+ + + +
+
+ + +
+

get_columns_from_files() produces two dataframes: one that lists all columns from within each of the .csv's in a specified working directory and another that lists all columns which appear more than once across those .csv's.

+
+ +
+
get_columns_from_files(wd = getwd(), common = FALSE)
+
+ +
+

Arguments

+
wd
+

String. Your specified working directory; points to the directory where the .csv files you want to work with live. I.e., getwd(), setwd("./data examples").

+ + +
common
+

Logical. Defaults to FALSE. In default status, the function returns a full dataframe of all columns within each of the files in your working directory. If set to TRUE, the function returns a single list of columns that occur more than once across all of your files.

+ +
+
+

Value

+ + +

one of two dataframes. If common set to FALSE, returns a dataframe of all columns in the files within your working directory. If common set to TRUE, returns a list of common columns across your files.

+
+
+

Details

+

get_columns_from_files() can be used as an initial step in data processing, particularly if the goal of the data processing is to merge multiple files into one, larger flat file. The function allows the user to preview and list out what columns exist within any given number of .csv's in a format that is more digestible. If the user chooses, they can also find commonalities across the columns in those files, highlighting any columns that serve as key variables upon which dataframes can then be joined.

+
+ +
+

Examples

+
if (FALSE) {
+get_columns_from_files(wd = setwd("./data examples"), common = TRUE)
+}
+
+
+
+
+ +
+ + +
+ +
+

Site built with pkgdown 2.0.9.

+
+ +
+ + + + + + + + diff --git a/docs/reference/get_custom_flags.html b/docs/reference/get_custom_flags.html index ea347ac..32a5433 100644 --- a/docs/reference/get_custom_flags.html +++ b/docs/reference/get_custom_flags.html @@ -1,5 +1,5 @@ -Creates dataframe(s) summarizing data quality — get_custom_flags • QCkitExamples
-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.9.

diff --git a/docs/reference/get_dc_flags.html b/docs/reference/get_dc_flags.html index abf7674..9ea1495 100644 --- a/docs/reference/get_dc_flags.html +++ b/docs/reference/get_dc_flags.html @@ -1,7 +1,5 @@ -Create Table of Data Quality Flags in Flagging Columns within individual -data columns — get_dc_flags • QCkitCreate Table of Data Quality Flags in Flagging Columns within individual data columns — get_dc_flags • QCkit
@@ -136,7 +133,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.9.

diff --git a/docs/reference/get_df_flags.html b/docs/reference/get_df_flags.html index dfc837a..c77e72f 100644 --- a/docs/reference/get_df_flags.html +++ b/docs/reference/get_df_flags.html @@ -1,5 +1,5 @@ -Create Table of Data Quality Flags Found in Data Files within a Data Package — get_df_flags • QCkitCreate Table of Data Quality Flags Found in Data Files within a Data Package — get_df_flags • QCkit -

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.9.

diff --git a/docs/reference/get_dp_flags.html b/docs/reference/get_dp_flags.html index e797cdb..2ae4c95 100644 --- a/docs/reference/get_dp_flags.html +++ b/docs/reference/get_dp_flags.html @@ -1,5 +1,5 @@ -Create Table of Data Quality Flags Found in a Data Package — get_dp_flags • QCkitCreate Table of Data Quality Flags Found in a Data Package — get_dp_flags • QCkit -

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.9.

diff --git a/docs/reference/get_elevation.html b/docs/reference/get_elevation.html index 8bf2195..bb5a78e 100644 --- a/docs/reference/get_elevation.html +++ b/docs/reference/get_elevation.html @@ -1,5 +1,5 @@ -Add elevation to a dataset — get_elevation • QCkitAdd elevation to a dataset — get_elevation • QCkit @@ -140,7 +140,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.9.

diff --git a/docs/reference/get_park_polygon.html b/docs/reference/get_park_polygon.html index ab83402..f7cf908 100644 --- a/docs/reference/get_park_polygon.html +++ b/docs/reference/get_park_polygon.html @@ -1,5 +1,5 @@ -Retrieve the polygon information for the park unit from NPS REST services — get_park_polygon • QCkitRetrieve the polygon information for the park unit from NPS REST services — get_park_polygon • QCkitTaxonomic Rank Determination Function — get_taxon_rank • QCkitTaxonomic Rank Determination Function — get_taxon_rank • QCkit @@ -116,7 +116,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.9.

diff --git a/docs/reference/get_utm_zone.html b/docs/reference/get_utm_zone.html index dfe649a..ed4bdad 100644 --- a/docs/reference/get_utm_zone.html +++ b/docs/reference/get_utm_zone.html @@ -1,5 +1,5 @@ -Return UTM Zone — get_utm_zone • QCkitReturn UTM Zone — get_utm_zone • QCkitFunction reference • QCkitFunction reference • QCkit @@ -106,6 +106,10 @@

All functions generate_ll_from_utm()

Coordinate Conversion from UTM to Latitude and Longitude

+ +

get_columns_from_files()

+ +

Retrieve all columns from each dataset and columns that occur more than once across those datasets

get_custom_flags()

@@ -155,7 +159,7 @@

All functions
-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.9.

diff --git a/docs/reference/long2UTM.html b/docs/reference/long2UTM.html index 3db772f..b4d8395 100644 --- a/docs/reference/long2UTM.html +++ b/docs/reference/long2UTM.html @@ -1,5 +1,5 @@ -Return UTM Zone — long2UTM • QCkitReturn UTM Zone — long2UTM • QCkit -

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.9.

diff --git a/docs/reference/order_cols.html b/docs/reference/order_cols.html index a649648..eb51218 100644 --- a/docs/reference/order_cols.html +++ b/docs/reference/order_cols.html @@ -1,5 +1,5 @@ -Ordering Columns Function 03-21-2023 — order_cols • QCkitOrdering Columns Function 03-21-2023 — order_cols • QCkit @@ -113,7 +113,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.9.

diff --git a/docs/reference/replace_blanks.html b/docs/reference/replace_blanks.html index 10abf1c..97011e7 100644 --- a/docs/reference/replace_blanks.html +++ b/docs/reference/replace_blanks.html @@ -1,5 +1,5 @@ -Replaces all blank cells with NA — replace_blanks • QCkitReplaces all blank cells with NA — replace_blanks • QCkit @@ -117,7 +117,7 @@

Examples

-

Site built with pkgdown 2.0.6.

+

Site built with pkgdown 2.0.9.

diff --git a/docs/reference/te_check.html b/docs/reference/te_check.html index 9558552..672d5cc 100644 --- a/docs/reference/te_check.html +++ b/docs/reference/te_check.html @@ -1,5 +1,5 @@ -Threatened Or Endangered Species Checker Function — te_check • QCkitThreatened Or Endangered Species Checker Function — te_check • QCkitCoordinate Conversion from UTM to Latitude and Longitude — utm_to_ll • QCkitCoordinate Conversion from UTM to Latitude and Longitude — utm_to_ll • QCkitCheck whether a coordinate pair is within the polygon of a park unit — validate_coord • QCkitCheck whether a coordinate pair is within the polygon of a park unit — validate_coord • QCkitTest whether decimal GPS coordinates are inside a park unit — validate_coord_list • QCkitTest whether decimal GPS coordinates are inside a park unit — validate_coord_list • QCkitRetrieve all columns from each dataset and columns that occur more than once across those datasets — get_columns_from_files • QCkitRetrieve all columns from each dataset and columns that occur more than once across those datasets — get_columns_from_files • QCkit @@ -65,7 +65,7 @@

Retrieve all columns from each dataset and columns that occur more than once
-

get_columns_from_files() produces two dataframes: one that lists all columns from within each of the .csv's in a specified working directory and another that lists all columns which appear more than once across those .csv's.

+

get_columns_from_files() produces two dataframes: one that lists all columns from within each of the .csv's in a specified working directory and another that lists all columns which appear more than once across those .csv's.

@@ -75,22 +75,22 @@

Retrieve all columns from each dataset and columns that occur more than once

Arguments

wd
-

String. Your specified working directory; points to the directory where the .csv files you want to work with live. I.e., getwd(), setwd("./data examples").

+

String. Your specified working directory; points to the directory where the .csv files you want to work with live. I.e., getwd(), setwd("./data examples").

common
-

Logical. Defaults to FALSE. In default status, the function returns a full dataframe of all columns within each of the files in your working directory. If set to TRUE, the function returns a single list of columns that occur more than once across all of your files.

+

Logical. Defaults to FALSE. In default status, the function returns a full dataframe of all columns within each of the files in your working directory. If set to TRUE, the function returns a single list of columns that occur more than once across all of your files.

Value

-

one of two dataframes. If common set to FALSE, returns a dataframe of all columns in the files within your working directory. If common set to TRUE, returns a list of common columns across your files.

+

one of two dataframes. If common set to FALSE, returns a dataframe of all columns in the files within your working directory. If common set to TRUE, returns a list of common columns across your files.

Details

-

get_columns_from_files() can be used as an initial step in data processing, particularly if the goal of the data processing is to merge multiple files into one, larger flat file. The function allows the user to preview and list out what columns exist within any given number of .csv's in a format that is more digestible. If the user chooses, they can also find commonalities across the columns in those files, highlighting any columns that serve as key variables upon which dataframes can then be joined.

+

get_columns_from_files() can be used as an initial step in data processing, particularly if the goal of the data processing is to merge multiple files into one, larger flat file. The function allows the user to preview and list out what columns exist within any given number of .csv's in a format that is more digestible. If the user chooses, they can also find commonalities across the columns in those files, highlighting any columns that serve as key variables upon which dataframes can then be joined.

diff --git a/man/get_columns_from_files.Rd b/man/get_columns_from_files.Rd index c63dadc..538a8ac 100644 --- a/man/get_columns_from_files.Rd +++ b/man/get_columns_from_files.Rd @@ -7,18 +7,18 @@ get_columns_from_files(wd = getwd(), common = FALSE) } \arguments{ -\item{wd}{String. Your specified working directory; points to the directory where the .csv files you want to work with live. I.e., \code{getwd()}, \code{setwd("./data examples")}.} +\item{wd}{String. Your specified working directory; points to the directory where the .csv files you want to work with live. I.e., \code{getwd()}, \code{setwd("./data examples")}.} -\item{common}{Logical. Defaults to \code{FALSE}. In default status, the function returns a full dataframe of all columns within each of the files in your working directory. If set to \code{TRUE}, the function returns a single list of columns that occur more than once across all of your files.} +\item{common}{Logical. Defaults to \code{FALSE}. In default status, the function returns a full dataframe of all columns within each of the files in your working directory. If set to \code{TRUE}, the function returns a single list of columns that occur more than once across all of your files.} } \value{ -one of two dataframes. If common set to \code{FALSE}, returns a dataframe of all columns in the files within your working directory. If common set to \code{TRUE}, returns a list of common columns across your files. +one of two dataframes. If common set to \code{FALSE}, returns a dataframe of all columns in the files within your working directory. If common set to \code{TRUE}, returns a list of common columns across your files. } \description{ -\code{get_columns_from_files()} produces two dataframes: one that lists all columns from within each of the .csv's in a specified working directory and another that lists all columns which appear more than once across those .csv's. +\code{get_columns_from_files()} produces two dataframes: one that lists all columns from within each of the .csv's in a specified working directory and another that lists all columns which appear more than once across those .csv's. } \details{ -\code{get_columns_from_files()} can be used as an initial step in data processing, particularly if the goal of the data processing is to merge multiple files into one, larger flat file. The function allows the user to preview and list out what columns exist within any given number of .csv's in a format that is more digestible. If the user chooses, they can also find commonalities across the columns in those files, highlighting any columns that serve as key variables upon which dataframes can then be joined. +\code{get_columns_from_files()} can be used as an initial step in data processing, particularly if the goal of the data processing is to merge multiple files into one, larger flat file. The function allows the user to preview and list out what columns exist within any given number of .csv's in a format that is more digestible. If the user chooses, they can also find commonalities across the columns in those files, highlighting any columns that serve as key variables upon which dataframes can then be joined. } \examples{ \dontrun{