Easy Data Import Using GUI File Picker and Seamless Communication Between an Excel and R

Choosing any rectangular data file using interactive GUI dialog box, and seamlessly manipulating tidy data between an 'Excel' window and R session.


License: GPLv3 CRANstatus TotalDownloads Lifecycle:stable Travis buildstatus AppVeyor buildstatus Codecov testcoverage

The goal of ezpickr is to provide R beginners with a convenient way to pick up their data files and to easily import it as a tidy tibble form into an R environment using GUI file-picker dialogue box (through ezpickr::pick()), and to provide R users with a convenient way to open and manipulate their data objects using Excel application for a seamless data communication between an Excel window and R session through ezpickr::viewxl()).

You can alternatively use ezpickr::pick() function for choosing *.csv, *.csv2, *.tsv, *.txt, *.xls, *.xlsx, *.json, *.html, *.htm, *.php, *.pdf, *.doc, *.docx, *.rtf, *.RData, *.Rda, *.RDS, *.sav (SPSS), *.por, *.sas7bdat, *.sas7bcat, *.dta, *.xpt, and *.mbox files in an interactive GUI mode A file choose dialog box will be prompted.

Any additional arguments available for each file type and extension: readr::read_csv() for CSV (Comma-Separated Values) files; readr::read_csv2() for CSV2 (Semicolon-Separated Values) files; readr::read_tsv() for ‘TSV’ (Tab-Separated Values) files; readr::read_file() for ‘txt’ (plain text) files; readxl::read_excel() for ‘Excel’ files; haven::read_spss() for ‘SPSS’ files; haven::read_stata() for ‘Stata’ files; haven::read_sas() for ‘SAS’ files; textreadr::read_document() for ‘Microsoft Word’, ‘PDF’, ‘RTF’, ‘HTML’, ‘HTM’, and ‘PHP’ files; jsonlite::fromJSON() for ‘JSON’ files; mboxr::read_mbox() for ‘mbox’ files; base::readRDS() for ‘RDS’ files; base::load() for ‘RDA’ and ‘RDATA’ files.

Each corresponding function depending upon a file extension will be automatically matched and applied once you pick up your file using either the GUI-file-chooser dialog box or explicit path/to/filename.

Installation

Development Version

You can install the latest development version as follows:

if(!require(devtools)) {
install.packages("devtools")
}
 
devtools::install_github('jooyoungseo/ezpickr')

Stable Version

You can install the released version of ezpickr from CRAN with:

install.packages("ezpickr")

Example

Usage of the pick() Function

This is a basic example which shows you how to import data files:

library(ezpickr)
 
# Choosing file and saving it into a variable
## Scenario 1: Picking up a file using interactive GUI dialog box:
data <- pick() ## Please use `picko()` instead if your path/file contains any Korean characters.
 
## Scenario 2: Picking up a file using an explicit file name ("test.sav" in the example below; however, you can feed other files through this function such as *.SAS, *.DTA, *.csv, *.csv2, *.tsv, *.xlsx, *.txt, *.html, webpage URL, *.json, *.Rda, *.Rdata, and more):
data <- pick("test.sav") ## Please use `picko("test.sav")` instead if your path/file contains any Korean characters.
 
# Now you can use the imported file as a tibble data frame.
str(data)

Usage of the viewxl() Function

You can open any data.frame, tibble, matrix, table or vector from an R session into your default-set spreadsheet application window as follows:

library(ezpickr)
 
data(airquality)
str(airquality)
 
# Use `viewxl()` function to open your data object in your spreadsheet:
viewxl(airquality)
 
# Then, when necessary, you can modify the opened data in the spreadsheet and save it as a new data.
 
# You can pass a list object to the `viewxl()` function like below:
l <- list(iris = iris, mtcars = mtcars, chickwts = chickwts, quakes = quakes)
viewxl(l)
# Then, each list item will appear in your Excel window sheet by sheet.

News

ezpickr 1.0.5

  • pick() and picko() functions now allow users to specify value-separator parameter using delim option for *.csv, *.csv2, and *.tsv files when the expected delimitters are not used. For example, in any event your csv file is separating each value using whitespace instead of comma(,) do the following:
data <- pick(delim=" ")

ezpickr 1.0.4

  • "xpt" file format is now supported in pick() function.
  • Atomic class (vector) is now supported in viewxl() function.

ezpickr 1.0.3

  • A critical bug that users cannot use the additional arguments of readxl::read_excel() for an Excel format within both pick() and picko() functions has been resolved; by default an Excel file with multiple sheets is returned as a list object when users have not passed any additional arguments.

ezpickr 1.0.2

  • purrr package has been added to the import package list to efficiently return multiple Excel sheets as a list of tibble; this way offers a better performance than the previous lapply() mechanism.
  • Users can now access a multi-sheet Excel file with each sheet name as well as its index number when using pick() and picko() functions.
  • A bug that users cannot utilize explicit Korean path/file when mode option is specified in pick() function has been resolved; Korean users now can use explicit Korean-included path/file in picko() function as well.
  • view() function is now deprecated to avoid any collision with tibble::view() function which has the same name; users is recommended to use viewxl() function in the future instead.
  • view() and viewxl() functions now return a tibble object reflecting users' real-time manipulation done in Excel.
  • view() and viewxl() functions have been fixed to process multiple sheets as a list object.
  • mbox file format is now supported in both pick() and picko() functions using mboxr::read_mbox() function under the hood.

ezpickr 1.0.1

  • New function picko() has been added to assist Korean R users in importing Korean-included path/to/file as an alternative of pick() function; other non-Korean R users can still employ the existing pick() function.
  • A more robust mechanism has been applied to a file path that contains any Korean characters.
  • pick() and picko() functions now automatically return an Excel file that contains more than one sheet as a list of each Work Sheet (Thanks hyun seung Lee for the suggestion via email).
  • view() function now internally employs writexl::write_xlsx() function instead of readr::write_csv() to create Microsoft Excel file to provide users with a stable encoding consistency; since this change, mode option of the view() function has been removed.
  • table class is now supported in view() function by automatically converting it into data.frame class.
  • Startup message has been added to the package so that Korean R users can benefit from the newly developed picko() function when interacting with Korean-included dataset.

ezpickr 1.0.0

  • mode argument has been added to pick() function to accommodate Korean R users' needs in terms of R session locale and encoding to Korean. Available values include "ko1" for "CP949" and "ko2" for "UTF-8" while both change R locale into Korean.
  • view() function has been newly added to provide R beginners with a convenient way to place their data in a spread sheet application.

ezpickr 0.1.3

  • Unused dependencies are moved to "suggest" from "import" field in the description file not to force unnecessary installation for users.
  • interactive() condition is added to the pick() example to avoid any error when called in a non-interactive testing environment.

ezpickr 0.1.2

  • NEWS file is added to help HTML page.
  • Authorship fixed for Soyoung Choi from contributor to author role for her considerable help for the pick() function.

ezpickr 0.1.1

  • Providing a sample test file airquality.sav for an example purpose.
  • Now pick() function returns a JSON file into a tibble form.
  • Returning a tibble form for RDA, RData, and RDS as well when pick() function is applied.

ezpickr 0.1.0

  • Added a NEWS.md file to track changes to the package.
  • Initial release.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("ezpickr")

1.2.0 by JooYoung Seo, 16 days ago


https://github.com/jooyoungseo/ezpickr


Report a bug at https://github.com/jooyoungseo/ezpickr/issues


Browse source code at https://github.com/cran/ezpickr


Authors: JooYoung Seo [aut, cre] , Soyoung Choi [aut] , hyun seung Lee [ctb] , Jonghoen Kim [ctb]


Documentation:   PDF Manual  


GPL-3 license


Imports readr, haven, jsonlite, readxl, magrittr, textreadr, tibble, stringr, writexl, purrr, mboxr, vroom, rmarkdown, utils

Suggests testthat, knitr, striprtf, xml2, tesseract, dplyr, rvest, docxtractr, antiword, covr


See at CRAN