Title: | Quantitative Text Kit |
---|---|
Description: | Support package for the textbook "An Introduction to Quantitative Text Analysis for Linguists: Reproducible Research using R" (Francom, 2024) <doi:10.4324/9781003393764> (available only after August 12, 2024). Includes functions to acquire, clean, and analyze text data as well as functions to document and share the results of text analysis. The package is designed to be used in conjunction with the book, but can also be used as a standalone package for text analysis. |
Authors: | Jerid Francom [aut, cre, cph]
|
Maintainer: | Jerid Francom <[email protected]> |
License: | GPL (>= 3) |
Version: | 0.10.0 |
Built: | 2024-06-16 04:26:24 UTC |
Source: | https://github.com/qtalr/qtkit |
Data frame with attributes about the data origin, written to a CSV file and optionally returned.
create_data_origin(file_path, return = FALSE, force = FALSE)
create_data_origin(file_path, return = FALSE, force = FALSE)
file_path |
File path where the data origin file should be saved. |
return |
Logical value indicating whether the data origin should be returned. |
force |
Logical value indicating whether to overwrite the file if it already exists. |
A data frame containing the data origin information.
tmp_file <- tempfile(fileext = ".csv") create_data_origin(tmp_file)
tmp_file <- tempfile(fileext = ".csv") create_data_origin(tmp_file)
Possible file types include .zip, .gz, .tar, and .tgz
get_archive_data(url, target_dir, force = FALSE, confirmed = FALSE)
get_archive_data(url, target_dir, force = FALSE, confirmed = FALSE)
url |
A character vector representing the full url to the compressed file |
target_dir |
The directory where the archive file should be downloaded |
force |
An optional argument which forcefully overwrites existing data |
confirmed |
If |
NULL, the archive file is unarchived in the target directory
test_dir <- file.path(tempdir(), "test") url <- "https://raw.githubusercontent.com/qtalr/qtkit/main/inst/extdata/test_data.zip" get_archive_data( url = url, target_dir = test_dir, confirmed = TRUE )
test_dir <- file.path(tempdir(), "test") url <- "https://raw.githubusercontent.com/qtalr/qtkit/main/inst/extdata/test_data.zip" get_archive_data( url = url, target_dir = test_dir, confirmed = TRUE )