Wanted: cdata Test Pilots

February 25, 2018
By

(This article was first published on R – Win-Vector Blog, and kindly contributed to R-bloggers)

I need a few volunteers to please “test pilot” the development version of the R package cdata, please.

Jackie Cochran at 1938 Bendix Race
Jacqueline Cochran: at the time of her death, no other pilot held more speed, distance, or altitude records in aviation history than Cochran.

Our cdata package has an upcoming new feature called “build_frame()” that allows for the very easy and legible entry of example data.frames. It allows one to type in a data.frame in a row-oriented form (much like tibble::tribble()).

Using build_frame() we can type in a by-hand example data.frame as follows:

library("cdata")

d <- build_frame(
  "names", "x", "y" |
  "a"    , 1  ,  1  |
  "b"    , 2  ,  4  |
  "c"    , 3  ,  9  )

The idea is the above code looks very much like it prints (both are in a row-oriented form):

print(d)

#   names x  y
# 1     a 1  1
# 2     b 2  4
# 3     c 3  9

The number of columns was inferred from the location of the first infix operator “|“, and all other formatting details are irrelevant.

cdata also includes a printer that prints any simple data.frame (one containing only numeric, character, and logical values) in a ready to share format:

cat(draw_frame(
  data.frame(names = c('a', 'b', 'c'),
             x = c(1, 2, 3),
             y = c(1, 4, 9))
  ))

# build_frame(
#    "names", "x", "y" |
#    "a"    , 1  , 1   |
#    "b"    , 2  , 4   |
#    "c"    , 3  , 9   )

More information and examples can be found in the method documentation (help(build_frame), help(draw_frame), and help(qchar_frame), and the frame tools vignette.

This is new functionality, and I wouldn’t mind a few “test pilots” to generate some feedback before submitting this update to CRAN. Please consider filing issues on the project, or emailing me (email in the project description).

To try it you would need to install the development version of cdata, which in R can be accomplished by a series of command such as the following:

install.packages(c("devtools", "wrapr"))
devtools::install_github("WinVector/cdata")

I also strongly recommend R users check out cdata‘s primary function: next generation fluid reshaping of data (more teaching materials: 1, 2, 3, and 4). It is a new thing to learn, but it takes your data engineering and data wrangling to a whole new level.

To leave a comment for the author, please follow the link and comment on their blog: R – Win-Vector Blog.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...



If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.

Search R-bloggers

Sponsors

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)