diff --git a/.Rbuildignore b/.Rbuildignore index 277748c..29b8d83 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -3,3 +3,6 @@ cran-comments.md ^\.travis\.yml$ ^codecov\.yml$ +^_pkgdown\.yml$ +^docs$ +^pkgdown$ diff --git a/_pkgdown.yml b/_pkgdown.yml new file mode 100644 index 0000000..ebefe92 --- /dev/null +++ b/_pkgdown.yml @@ -0,0 +1,41 @@ +destination: docs +reference: + - title: "Data pasting functions" + desc: > + The good stuff. All of these have RStudio addin bindings. + contents: + - tribble_paste + - vector_paste + - vector_paste_vertical + - df_paste + - dt_paste + - tile: "Data printing functions" + desc: > + analagous to 'dput' + contents: + - dpasta + - title: "Data formatting functions" + desc: > + Send data formatted as code to the clipboard instead of automatically pasting. + contents: + - tribble_format + - vector_format + - vector_format_vertical + - df_format + - dt_format + - title: "Data returning functions" + desc: > + Return data formatted as code as a character vector. + contents: + - tribble_construct + - vector_construct + - vector_construct_vertical + - dfdt_construct + - title: "Configuration functions" + desc: > + Change the behaviour of datapasta. + contents: + - dp_set_max_rows + - dp_set_decimal_mark + + diff --git a/docs/404.html b/docs/404.html new file mode 100644 index 0000000..ef53605 --- /dev/null +++ b/docs/404.html @@ -0,0 +1,153 @@ + + + + + + + + +Page not found (404) • datapasta + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+
+ + +Content not found. Please use links in the navbar. + +
+ +
+ + + + +
+ + + + + + + + diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html new file mode 100644 index 0000000..7ce3a1c --- /dev/null +++ b/docs/LICENSE-text.html @@ -0,0 +1,155 @@ + + + + + + + + +License • datapasta + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+
+ + +
YEAR: 2017
+COPYRIGHT HOLDER: Miles McBain
+
+ +
+ +
+ + + + +
+ + + + + + + + diff --git a/docs/articles/datapasta-in-the-cloud.html b/docs/articles/datapasta-in-the-cloud.html new file mode 100644 index 0000000..b33b5e3 --- /dev/null +++ b/docs/articles/datapasta-in-the-cloud.html @@ -0,0 +1,167 @@ + + + + + + + +Datapasta in the cloud • datapasta + + + + + + + + + + +
+
+ + + + +
+
+ + + + +

It is now possible to paste data as formatted code in RStudio Server/Cloud, and ssh sessions. (Thanks Garrick Aden-Buie and Jon Harmon!)

+

There is no way to connect your local machine’s clipboard to the R session running on a cloud instance. So datapasta cannot work as per local usage.

+

What has been developed instead are two kinds of fallback behaviour that capture most of the magic!

+
+

+Fallback 1: Text selection

+

If datapasta detects the clipboard is not available and the editor is RStudio, it will check to see if there is a text selection active (highlighted text).

+

Given a selection, it will read that text instead of the clipboard and proceed as per the called function, e.g. attempt to parse that text as data and paste as a tribble if tribble_paste was called.

+

The imagined workflow here is:

+
    +
  1. Copy data from external application
  2. +
  3. Paste as text into an RStudio pane (exposing it to your remote R session)
  4. +
  5. Select text and call datapasta function/addin
  6. +
  7. Text is transformed into code defining data.
  8. +
+
+
+

+Fallback 2: Pop-up text editor

+

Again if there is no clipboard available, but in this case there is no text selected in RStudio (or you’re not in RStudio), datapasta will open a temporary file and then call utils::file.edit() on it.

+

In RStudio server/cloud this will pop-up a modal text editor window where text can be pasted. When the editor is closed, the text will be read by datapasta and then things will proceed as if that data had come from the clipboard. The temporary file is deleted immediately after being read.

+

If you’re not in RStudio, but on the command line in an ssh session, this will open a command line text editor instead of the modal window.

+

The workflow in this case is:

+
    +
  1. Copy data from external application
  2. +
  3. Call datapasta function/addin
  4. +
  5. Text editor window opens, paste text into it
  6. +
  7. Text is transformed into code defining data and inserted at the cursor position.
  8. +
+
+

+Configuration

+

The first time the pop-up text editor is about to be opened in each session, datapasta issues a message in a modal dialogue to explain what is about to happen. This can be disabled with:

+
options(datapasta.quiet_manual_paste = TRUE)
+
+
+
+ + + +
+ + + + +
+ + + + + + diff --git a/docs/articles/how-to-datapasta.html b/docs/articles/how-to-datapasta.html new file mode 100644 index 0000000..d11f5ba --- /dev/null +++ b/docs/articles/how-to-datapasta.html @@ -0,0 +1,431 @@ + + + + + + + +How to Datapasta • datapasta + + + + + + + + + + +
+
+ + + + +
+
+ + + + +

Datapasta provides RStudio addins and functions that give you complete freedom copy-paste data to and from your source editor, formatted for immediate use. Note: repeated use has been known to cause titilation and giddiness.

+

Places I’ve found this power useful:

+
    +
  • Copying tables from Excel, Jupyter, and websites, where the source file cannot be easily read.
  • +
  • Embedding small-ish amounts of raw data from .csv into Rmarkdown files. The file thus contains code documentation and data, attaining the holy trinity of reproducibility.
  • +
  • Quickly pasting vector output from other queries into dplyr::filter( .. %in% ..).
  • +
  • Adding datasets to readily reproducible examples for posting to StackOverflow, Slack channels etc.
  • +
  • Creating c() expressions with a LOT less typing and fiddling.
  • +
+

Typical usage takes full advantage of addins within RStudio, however datapasta can be used with any R editor, even just the terminal. The typical RStudio case is described in full detail below, followed by the fallback behaviour.

+
+

+Typical Usage with Rstudio

+
+

+Pasting a table as a formatted tibble definition with tribble_paste() +

+

You can copy this html table of Brisbane weather forecasts:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
XLocationMinMax
Partly cloudy.Brisbane1929
Partly cloudy.Brisbane Airport1827
Possible shower.Beaudesert1530
Partly cloudy.Chermside1729
Shower or two. Possible storm.Gatton1532
Possible shower.Ipswich1530
Partly cloudy.Logan Central1829
Mostly sunny.Manly2026
Partly cloudy.Mount Gravatt1728
Possible shower.Oxley1730
Partly cloudy.Redcliffe1927
+

And make this appear at the current cursor:

+ +

tibble::tribble() or ‘transposed tibble’ is a really neat function that allows a tibble to be written in human readable format (Thanks be to Hadley).

+

To paste data as a tribble() call, just copy the table header and data rows, then paste into the source editor using the addin Paste as tribble. For best results, assign the addin to a memorable keyboard shortcut, e.g. ctrl + shift + t. See Customizing Keyboard Shortcuts.

+

tribble_paste() is a flexible function that guesses the separator and types of the data it pulls from the clipboard. Mostly this seems to work well. Occasionally it epic-fails. The supported separators are \| (pipe), \t (tab), , (comma), ;(semicolon). Most data copied from the internet or spreadsheets will be tab delimited. It will also attempt to recognise a lack of a header row and create a default for you, although this is not always possible.

+
+
+

+Pasting a list as a horizontal vector with vector_paste() +

+

A list could be a row or column of a spreadsheet or intermediate output. With the Paste as vector addin you can go from something like:

+
Mint    Fedora  Debian  Ubuntu  OpenSUSE
+

or

+
Mint, Fedora, Debian, Ubuntu, OpenSUSE
+

or

+
Mint
+Fedora
+Debian
+Ubuntu
+OpenSUSE
+

to

+
c("Mint", "Fedora", "Debian", "Ubuntu", "OpenSUSE")
+

This is pasted into the source editor at the current cursor.

+

Just like tribble_paste(), vector_paste() has a flexible parser that can guess the type and separator of the data. The supported separators are \| (pipe), \t (tab), , (comma), ;(semicolon) and end of line. The recommended keyboard shortcut is crtl + alt + shift + v.

+
+
+

+Pasting a list as a vertical vector with vector_paste_vertical() +

+

Given the same types of list inputs as above, the Paste as vector (vertical) addin pastes the output with each element on its own line, e.g.:

+ +

This is much nicer for long lists. I have found this is actually the version I use more often. I recommend using ctrl + shift + v as keyboard shortcut.

+

##Pasting as a data.frame with df_paste() The parser here is identical to tribble_paste() and has all the same type and separator guessing goodness. The difference is the output will be a formatted call to base::data.frame(). Some sensible line wrapping rules etc are implemented. Useful for purists and educators alike. Special thanks to Jonathan Carroll for contributing this feature.

+

So the Brisbane weather table from above becomes:

+
data.frame(
+           X = c("Partly cloudy.", "Partly cloudy.", "Possible shower.",
+                 "Partly cloudy.", "Shower or two. Possible storm.",
+                 "Possible shower.", "Partly cloudy.", "Mostly sunny.", "Partly cloudy.",
+                 "Possible shower.", "Partly cloudy."),
+    Location = c("Brisbane", "Brisbane Airport", "Beaudesert", "Chermside",
+                 "Gatton", "Ipswich", "Logan Central", "Manly",
+                 "Mount Gravatt", "Oxley", "Redcliffe"),
+         Min = c(19, 18, 15, 17, 15, 15, 18, 20, 17, 17, 19),
+         Max = c(29, 27, 30, 29, 32, 30, 29, 26, 28, 30, 27)
+)
+

For a shortcut you could try ctrl + shift + d.

+
+
+

+Outputting data from your R evironment

+
+

+Output to R with dpasta() +

+

All of the above addin functions can be called directly with an R object argument. When run, this will result in the object being output at the current cursor. Usually the next line. To make things more magical, a there is a single function dpasta that will match the argument with the appropriate _paste() function based on its class. This means:

+ +

results in:

+
data.frame(
+      Sepal.Length = c(5.1, 4.9, 4.7, 4.6, 5, 5.4),
+       Sepal.Width = c(3.5, 3, 3.2, 3.1, 3.6, 3.9),
+      Petal.Length = c(1.4, 1.4, 1.3, 1.5, 1.4, 1.7),
+       Petal.Width = c(0.2, 0.2, 0.2, 0.2, 0.2, 0.4),
+           Species = as.factor(c("setosa", "setosa", "setosa", "setosa", "setosa",
+                                 "setosa"))
+   )
+

while:

+ +

will give you:

+ +
+
+
+

+Avoiding fiddly data formatting

+

There are two addins that operate on RStudio cursor selections to make your life easier:

+
+

+Fiddle Selections unitl they’re better

+

Fiddle Selection is intended to remove some fiddly tasks from your workflow. It can turn raw data like 1 2 3 into c(1,2,3), then pivot from that to:

+
c(1,
+  2,
+  3)
+

and back again to c(1,2,3). The parser here is really flexible too. It will accept data delimited by any combination of spaces, commas, and newlines.

+

Fiddle Selection Can also reflow messy tribble() and data.frame() expressions into neatly aligned ones, say after hand editing.

+
+
+

+Toggle Quotes

+

Toggle Vector Quotes will convert a selected expression like c(a,b,c) to a quoted version i.e c("a","b","c"). If it’s already quoted it will convert the other way to a bare version. All elements will be quoted if there’s a mixture. It also works with vertically algined expressions.

+

With the combination of these two you can get really lazy e.g. go from:

+
some stuff I typed
+
+#To
+
+c("some",
+  "stuff",
+  "I",
+  "typed") # mostly
+
+

in a couple of keystrokes!

+

Try assigning these addins to ctrl + shift + f and ctrl + shift + q respectively.

+
+
+
+

+Output to clipboard with dmdclip() +

+

dmdclip() can help you take the data to somewhere that uses markdown format, for example a Stack Overflow question or Github issue. This function will copy the resulting formatted data object call to the clipboard, inserting 4 spaces at the head of each line, which is markdown syntax for a pre-formatted block.

+

So:

+ +

Will paste the following on the clipboard:

+
    data.frame(
+       Sepal.Length = c(5.1, 4.9, 4.7, 4.6, 5, 5.4),
+        Sepal.Width = c(3.5, 3, 3.2, 3.1, 3.6, 3.9),
+       Petal.Length = c(1.4, 1.4, 1.3, 1.5, 1.4, 1.7),
+        Petal.Width = c(0.2, 0.2, 0.2, 0.2, 0.2, 0.4),
+            Species = as.factor(c("setosa", "setosa", "setosa", "setosa", "setosa",
+                                  "setosa"))
+    )
+
+
+
+

+Usage without RStudio

+

The rstudioapi package enables the calling of addins and output to the cursor. If the API is not detected, all the _paste() functions, and dpasta will output their text to the console, ready for copying and pasting to an editor window.

+

In this scenario you may wish to avoid installation of the rstudioapi package dependency. Use install.packages("datapasta", dependencies = "Depends") to avoid API installation, but be sure to follow up with install.packages(c("readr","clipr")).

+

note: The dpasta() function can be used without clipr installed, but you’re missing out on a fair amount of awesomeness if you limit yourself to that.

+
+

+Custom Behaviour for Your Unique Slowflake Setup

+

Custom behaviour can be created by taking advantage of the _construct() variants of the _paste() functions, as these return their output as an R object which can then be written to an appropriate buffer or clipboard.

+

for example, if you copied the Brisbane weather forecast from above to the clipboard and then called:

+ +

trib_call now contains a the tribble call as a character vector. You could then write this with:

+
write(trib_call, file = ..your desired location..)
+#OR
+clipr::write_clip(trib_call) #Send it back to the clipboard.
+
+
+
+

+Configurable Options

+
+

+Upping the row guard

+

For your protection, datapasta will initially refuse to output R objects of 200 or more rows. Up the row limit for your specific scenario with dp_set_max_rows(n). Large numbers of rows could take a long time to format. In extreme cases you could crash your R/RStudio session.

+
+
+

+Deailing with “,” decimal marks

+

Use dp_set_decimal_mark(",") to handle numbers like 3,14.

+
+
+
+ + + +
+ + + + +
+ + + + + + diff --git a/docs/articles/index.html b/docs/articles/index.html new file mode 100644 index 0000000..4855264 --- /dev/null +++ b/docs/articles/index.html @@ -0,0 +1,158 @@ + + + + + + + + +Articles • datapasta + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+
+ + +
+

All vignettes

+

+ + +
+
+
+ + + +
+ + + + + + + + diff --git a/docs/authors.html b/docs/authors.html new file mode 100644 index 0000000..dabf06d --- /dev/null +++ b/docs/authors.html @@ -0,0 +1,182 @@ + + + + + + + + +Authors • datapasta + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+
+ + +
    +
  • +

    Miles McBain. Author, maintainer. ORCID +

    +
  • +
  • +

    Jonathan Carroll. Author. ORCID +

    +
  • +
  • +

    Mark Dulhunty. Contributor. +

    +
  • +
  • +

    Andrew Collier. Contributor. +

    +
  • +
  • +

    Sharla Gelfand. Author. +

    +
  • +
  • +

    Suthira Owlarn. Author. ORCID +

    +
  • +
  • +

    Garrick Aden-Buie. Author. ORCID +

    +
  • +
+ +
+ +
+ + + + +
+ + + + + + + + diff --git a/docs/docsearch.css b/docs/docsearch.css new file mode 100644 index 0000000..e5f1fe1 --- /dev/null +++ b/docs/docsearch.css @@ -0,0 +1,148 @@ +/* Docsearch -------------------------------------------------------------- */ +/* + Source: https://github.com/algolia/docsearch/ + License: MIT +*/ + +.algolia-autocomplete { + display: block; + -webkit-box-flex: 1; + -ms-flex: 1; + flex: 1 +} + +.algolia-autocomplete .ds-dropdown-menu { + width: 100%; + min-width: none; + max-width: none; + padding: .75rem 0; + background-color: #fff; + background-clip: padding-box; + border: 1px solid rgba(0, 0, 0, .1); + box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .175); +} + +@media (min-width:768px) { + .algolia-autocomplete .ds-dropdown-menu { + width: 175% + } +} + +.algolia-autocomplete .ds-dropdown-menu::before { + display: none +} + +.algolia-autocomplete .ds-dropdown-menu [class^=ds-dataset-] { + padding: 0; + background-color: rgb(255,255,255); + border: 0; + max-height: 80vh; +} + +.algolia-autocomplete .ds-dropdown-menu .ds-suggestions { + margin-top: 0 +} + +.algolia-autocomplete .algolia-docsearch-suggestion { + padding: 0; + overflow: visible +} + +.algolia-autocomplete .algolia-docsearch-suggestion--category-header { + padding: .125rem 1rem; + margin-top: 0; + font-size: 1.3em; + font-weight: 500; + color: #00008B; + border-bottom: 0 +} + +.algolia-autocomplete .algolia-docsearch-suggestion--wrapper { + float: none; + padding-top: 0 +} + +.algolia-autocomplete .algolia-docsearch-suggestion--subcategory-column { + float: none; + width: auto; + padding: 0; + text-align: left +} + +.algolia-autocomplete .algolia-docsearch-suggestion--content { + float: none; + width: auto; + padding: 0 +} + +.algolia-autocomplete .algolia-docsearch-suggestion--content::before { + display: none +} + +.algolia-autocomplete .ds-suggestion:not(:first-child) .algolia-docsearch-suggestion--category-header { + padding-top: .75rem; + margin-top: .75rem; + border-top: 1px solid rgba(0, 0, 0, .1) +} + +.algolia-autocomplete .ds-suggestion .algolia-docsearch-suggestion--subcategory-column { + display: block; + padding: .1rem 1rem; + margin-bottom: 0.1; + font-size: 1.0em; + font-weight: 400 + /* display: none */ +} + +.algolia-autocomplete .algolia-docsearch-suggestion--title { + display: block; + padding: .25rem 1rem; + margin-bottom: 0; + font-size: 0.9em; + font-weight: 400 +} + +.algolia-autocomplete .algolia-docsearch-suggestion--text { + padding: 0 1rem .5rem; + margin-top: -.25rem; + font-size: 0.8em; + font-weight: 400; + line-height: 1.25 +} + +.algolia-autocomplete .algolia-docsearch-footer { + width: 110px; + height: 20px; + z-index: 3; + margin-top: 10.66667px; + float: right; + font-size: 0; + line-height: 0; +} + +.algolia-autocomplete .algolia-docsearch-footer--logo { + background-image: url("data:image/svg+xml;utf8,"); + background-repeat: no-repeat; + background-position: 50%; + background-size: 100%; + overflow: hidden; + text-indent: -9000px; + width: 100%; + height: 100%; + display: block; + transform: translate(-8px); +} + +.algolia-autocomplete .algolia-docsearch-suggestion--highlight { + color: #FF8C00; + background: rgba(232, 189, 54, 0.1) +} + + +.algolia-autocomplete .algolia-docsearch-suggestion--text .algolia-docsearch-suggestion--highlight { + box-shadow: inset 0 -2px 0 0 rgba(105, 105, 105, .5) +} + +.algolia-autocomplete .ds-suggestion.ds-cursor .algolia-docsearch-suggestion--content { + background-color: rgba(192, 192, 192, .15) +} diff --git a/docs/docsearch.js b/docs/docsearch.js new file mode 100644 index 0000000..b35504c --- /dev/null +++ b/docs/docsearch.js @@ -0,0 +1,85 @@ +$(function() { + + // register a handler to move the focus to the search bar + // upon pressing shift + "/" (i.e. "?") + $(document).on('keydown', function(e) { + if (e.shiftKey && e.keyCode == 191) { + e.preventDefault(); + $("#search-input").focus(); + } + }); + + $(document).ready(function() { + // do keyword highlighting + /* modified from https://jsfiddle.net/julmot/bL6bb5oo/ */ + var mark = function() { + + var referrer = document.URL ; + var paramKey = "q" ; + + if (referrer.indexOf("?") !== -1) { + var qs = referrer.substr(referrer.indexOf('?') + 1); + var qs_noanchor = qs.split('#')[0]; + var qsa = qs_noanchor.split('&'); + var keyword = ""; + + for (var i = 0; i < qsa.length; i++) { + var currentParam = qsa[i].split('='); + + if (currentParam.length !== 2) { + continue; + } + + if (currentParam[0] == paramKey) { + keyword = decodeURIComponent(currentParam[1].replace(/\+/g, "%20")); + } + } + + if (keyword !== "") { + $(".contents").unmark({ + done: function() { + $(".contents").mark(keyword); + } + }); + } + } + }; + + mark(); + }); +}); + +/* Search term highlighting ------------------------------*/ + +function matchedWords(hit) { + var words = []; + + var hierarchy = hit._highlightResult.hierarchy; + // loop to fetch from lvl0, lvl1, etc. + for (var idx in hierarchy) { + words = words.concat(hierarchy[idx].matchedWords); + } + + var content = hit._highlightResult.content; + if (content) { + words = words.concat(content.matchedWords); + } + + // return unique words + var words_uniq = [...new Set(words)]; + return words_uniq; +} + +function updateHitURL(hit) { + + var words = matchedWords(hit); + var url = ""; + + if (hit.anchor) { + url = hit.url_without_anchor + '?q=' + escape(words.join(" ")) + '#' + hit.anchor; + } else { + url = hit.url + '?q=' + escape(words.join(" ")); + } + + return url; +} diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..7fb0948 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,308 @@ + + + + + + + +R Tools for Data Copy-Pasta • datapasta + + + + + + + + + + +
+
+ + + + +
+
+ +
+ + +

+
+
+

+The Goods

+

pow!

+
+
+

+Introducing datapasta

+

datapasta is about reducing resistance associated with copying and pasting data to and from R. It is a response to the realisation that I often found myself using intermediate programs like Sublime to munge text into suitable formats. Addins and functions in datapasta support a wide variety of input and output situations, so it (probably) “just works”. Hopefully tools in this package will remove such intermediate steps and associated frustrations from our data slinging workflows.

+
+
+

+Prerequisites

+
    +
  • Linux users will need to install either xsel or xclip. These applications provide an interface to X selections (clipboard-like). +
      +
    • For example: sudo apt-get install xsel - it’s 72kb…
    • +
    +
  • +
  • Windows and MacOS have nothing extra to do.
  • +
+
+
+

+Installation

+
    +
  1. Get the package: install.packages("datapasta") +
  2. +
  3. Set the keyboard shortcuts using Tools -> Addins -> Browse Addins, then click Keyboard Shortcuts… +
  4. +
+
+
+

+Usage

+
+

+Use with RStudio

+
+

+Getting data into source

+

At the moment this package contains these RStudio addins that paste data to the cursor:

+
    +
  • +tribble_paste which pastes a table as a nicely formatted call to tibble::tribble() +
      +
    • Recommend Ctrl + Shift + t as shortcut.
    • +
    • Table can be delimited with tab, comma, pipe or semicolon.
    • +
    +
  • +
  • +vector_paste which will paste delimited data as a vector definition, e.g. c("a", "b") etc. +
      +
    • Recommend Ctrl + Alt + Shift + v as shortcut.
    • +
    +
  • +
  • +vector_paste_vertical which will paste delimited data as a vertically formatted vector definition. +
      +
    • Recommend Ctrl + Shift + v as shortcut
    • +
    • example output:
    • +
    +
    c("Mint",
    +"Fedora",
    +"Debian",
    +"Ubuntu",
    +"OpenSUSE")
    +
  • +
  • +df_paste which pastes a table on the clipboard as a standard data.frame definition rather than a tribble call. This has certain advantages in the context of reproducible examples and educational posts. Many thanks to Jonathan Carroll for getting this rolling and coding the bulk of the feature. +
      +
    • Recommend Ctrl + Alt + Shift + d as shortcut.
    • +
    +
  • +
  • +dt_paste which is the same as df_paste, but for data.table.
  • +
+
+
+

+Massaging data in source

+

There are two Addins that can help with creating and aliging data in your editor:

+
    +
  • +Fiddle Selection will perform magic on a selection. It can be used to: +
      +
    • Turn raw data delimited by any combination of commas, spaces, and newlines into a c() expression
    • +
    • Pivot a c() expr between horizontal and vertical layout.
    • +
    • Reflow messy tribble() and data.frame() exprs.
    • +
    • Recommend Ctrl +Shift + f as shortcut.
    • +
    +
  • +
  • +Toggle Vector Quotes will toggle a c() expr between all elements wrapped in "" and all bare unquoted form. Handy in combination with above to save mucho keystrokes. +
      +
    • Recommend Ctrl +Shift + q as shortcut.
    • +
    +
  • +
+
+
+

+Getting Data out of an R session

+

There are two R functions available that accept R objects and output formatted text for pasting to a reprex or other application:

+
    +
  • dpasta accepts tibbles, data.frames, and vectors. Data is output in a format that matches in input class. Formatted text is pasted at the cursor.

  • +
  • dmdclip accepts the same inputs as dpasta but inserts the formatted text onto the clipboard, preceded by 4 spaces so that is can be as pasted as a preformatted block to Github, Stackoverflow etc.

  • +
+
+
+
+

+Use with other editors

+

The only hard dependency of datapasta is readr for type guessing. All the above *paste functions can be called directly instead of as an addin, and will fall back to console output if the rstudioapi is not available.

+

On system without access to the clipboard (or without clipr installed) datapasta can still be used to output R objects from an R session. dpasta is probably the only function you care about in this scenario.

+
+

+Custom Installation

+

datapasta imports clipr and rstudioapi so as to make installation smooth and easy for most users. If you wish to avoid installing an rstudioapi you will never use you can use:

+ +
+
+
+
+

+Pitfalls

+
    +
  • +tribble_paste works well with CSVs, excel files, and html tables, but is currently brittle with respect to irregular table structures like merged cells or multi-line column headings. For some reason Wikipedia seems chock full of these. :(
  • +
  • Quoted csv data, where the quotes contain commas will not be parsed correctly.
  • +
  • Nested list columns have limited support with tribble_paste()/dpasta(). Nested lists of length 1 fail unless all are length 1 - It’s complicated. You still get some output so it might be viable to fix and reflow with Fiddle Selection. Tread with caution.
  • +
+
+
+

+Prior art

+

This package is made possible by mdlincon’s clipr, and Hadley’s packages tibble and readr (for data-type guessing). I especially appreciate clipr's thoughtful approach to the clipboard on Linux, which pretty much every other R clipboard package just nope’d out on.

+
+
+

+Future developments

+

I am interested in expanding the types of objects supported by the output functions dpasta. I would also like to eventualy have Fiddle Selection to pivot function calls and named vectors. Feel free to contribute your ideas to the open issues.

+
+
+

+Bonus

+

0 to datapasta in 64 seconds via a video vignette:

+

Datapasta in 64 seconds

+
+ +
+ + +
+ + + +
+ + + + + + diff --git a/docs/link.svg b/docs/link.svg new file mode 100644 index 0000000..88ad827 --- /dev/null +++ b/docs/link.svg @@ -0,0 +1,12 @@ + + + + + + diff --git a/docs/news/index.html b/docs/news/index.html new file mode 100644 index 0000000..ac0c3a6 --- /dev/null +++ b/docs/news/index.html @@ -0,0 +1,263 @@ + + + + + + + + +Changelog • datapasta + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+
+ + +
+

+datapasta 3.1.0 ‘Leave to Simmer’ Unreleased +

+
    +
  • Exported _format functions
  • +
  • Adds dt_paste function for pasting as data.table (Thanks @jonocarroll, #72, closes #70)
  • +
  • Row names are kept in data.frames and data.tables (Thanks @sowla)
  • +
  • Column names that are invalid are now handled with backticks (Thanks @sharlagelfand)
  • +
  • Fixes issue with commas inside character vectors getting wrapped on
  • +
  • data.frame (and data.table) print is much prettier and robust with all args and cols aligned on ‘=’
  • +
  • zero row tibbles are supported with a fall-back to a tibble::tibble() call
  • +
  • all _construct functions now return input visibly
  • +
  • Fallback behaviour added to allow usage with remote R sessions like RStudio Server/Cloud, or ssh command line. (Thanks @gadenbuie, @jonthegeek)
  • +
+
+
+

+datapasta 3.0.0 ‘Colander Helmet’ 2018-01-24 +

+
    +
  • When pasting from clipboard it now attempts to guess if there is no header row, in the case where the clipboard is all data. If you’re lucky it will create a default header for you when pasting (V1, V2, V3 etc.).
  • +
  • +dpasta() will now handle tribbles with R classes that cannot be represented in tribble form. It falls back to their character representation. This works well for things like dates.
  • +
  • New addin: ‘Fiddle Selection’. This is a kind of magic wand that can be waved over RStudio editor selections to: Reflow messy tribble and data.frame definitions, create c() expressions from raw data, and pivot c() exprs between vertical and horizontal format.
  • +
  • New addin: ‘Toggle Vector Quotes’. Given a horizontal or vertical c() expr, it will toggle all elements between quoted and bare format.
  • +
  • Complies with new CRAN policy on clipboard use. You cannot write to the clipboard in non-interactive sessions with dmdclip() - Why would you?. Tests containing clipboard use are skipped on CI and CRAN.
  • +
+
+
+

+datapasta 2.0.1 Unreleased +

+
    +
  • Added a trailing newline after all pastes, this works much nicer for console output.
  • +
  • Fixed handling of backslashes. Relying on built-in function deparse() for escaping chars that need it.
  • +
+
+
+

+datapasta 2.0.0 ‘Fusilli Jerry’ 2017-03-26 +

+
    +
  • Added the ability to parse objects from R and output as neatly formatted tibbles, dataframes and vectors with dpasta. The clipboard is not involved.
  • +
  • Added the ability to send these same types of objects to the clipboard formatted for markdown output with dmdclip.
  • +
  • Package can now operate in a close to fully featured way in editors other than RStudio. Output goes to console rather than cursor.
  • +
  • Added hooks for output customisation with _construct() functions that return the formatted output as an R character vector.
  • +
  • The decimal mark can be set for numeric data with dp_set_decimal_mark.
  • +
  • User can now paste natural looking comma separated lists as vectors, with automatic comma-splitting and whitespace trimming.
  • +
+
+
+

+datapasta 1.1.0 ‘CopyPesto’ 2017-01-09 +

+
    +
  • Added df_paste() which pastes a table from the clipboard using a nicely formatted call to data.frame() rather than tribble() +
  • +
  • Better handling for empty lines that get accidently copied onto clipboard with table. Gracefully ignored.
  • +
+
+
+

+datapasta 1.0.0 2016-11-29 +

+
    +
  • Added new addin ‘Paste as vector (vertical)’ to provide nicer formatting for long lists.
  • +
  • All addins now guess data types and format correctly in the source editor.
  • +
  • Empty rows in tables and empty cells in lists are formatted as NA’s when pasting instead of being ignored.
  • +
  • Added vignette, automated tests etc in prep for CRAN submission.
  • +
+
+
+

+datapasta 0.2 Unreleased +

+
    +
  • Added graceful error handling on failed parse of text on clipboard to table.
  • +
  • +tribble_paste() and vector_paste() now pastse NA’s as unquoted, so R will parse as propper NA.
  • +
  • +tribble_paste() can parse an paste table text copied from raw delimited file e.g. csv, tsv, pipe delimited, seimi-colon delimited.
  • +
  • +vector_paste() uses a space between elements.
  • +
+
+
+

+datapasta 0.1.1 Unreleased +

+
    +
  • Added a NEWS.md file to track changes to the package.
  • +
  • Fixed the handling of NAs in tab delimited files which resulted in phantom NA columns sometimes appearing with tribble_paste() +
  • +
+
+
+ + + +
+ + + +
+ + + + + + + + diff --git a/docs/pkgdown.css b/docs/pkgdown.css new file mode 100644 index 0000000..9145958 --- /dev/null +++ b/docs/pkgdown.css @@ -0,0 +1,256 @@ +/* Sticky footer */ + +/** + * Basic idea: https://philipwalton.github.io/solved-by-flexbox/demos/sticky-footer/ + * Details: https://github.com/philipwalton/solved-by-flexbox/blob/master/assets/css/components/site.css + * + * .Site -> body > .container + * .Site-content -> body > .container .row + * .footer -> footer + * + * Key idea seems to be to ensure that .container and __all its parents__ + * have height set to 100% + * + */ + +html, body { + height: 100%; +} + +body > .container { + display: flex; + height: 100%; + flex-direction: column; +} + +body > .container .row { + flex: 1 0 auto; +} + +footer { + margin-top: 45px; + padding: 35px 0 36px; + border-top: 1px solid #e5e5e5; + color: #666; + display: flex; + flex-shrink: 0; +} +footer p { + margin-bottom: 0; +} +footer div { + flex: 1; +} +footer .pkgdown { + text-align: right; +} +footer p { + margin-bottom: 0; +} + +img.icon { + float: right; +} + +img { + max-width: 100%; +} + +/* Fix bug in bootstrap (only seen in firefox) */ +summary { + display: list-item; +} + +/* Typographic tweaking ---------------------------------*/ + +.contents .page-header { + margin-top: calc(-60px + 1em); +} + +/* Section anchors ---------------------------------*/ + +a.anchor { + margin-left: -30px; + display:inline-block; + width: 30px; + height: 30px; + visibility: hidden; + + background-image: url(./link.svg); + background-repeat: no-repeat; + background-size: 20px 20px; + background-position: center center; +} + +.hasAnchor:hover a.anchor { + visibility: visible; +} + +@media (max-width: 767px) { + .hasAnchor:hover a.anchor { + visibility: hidden; + } +} + + +/* Fixes for fixed navbar --------------------------*/ + +.contents h1, .contents h2, .contents h3, .contents h4 { + padding-top: 60px; + margin-top: -40px; +} + +/* Sidebar --------------------------*/ + +#sidebar { + margin-top: 30px; + position: -webkit-sticky; + position: sticky; + top: 70px; +} +#sidebar h2 { + font-size: 1.5em; + margin-top: 1em; +} + +#sidebar h2:first-child { + margin-top: 0; +} + +#sidebar .list-unstyled li { + margin-bottom: 0.5em; +} + +.orcid { + height: 16px; + /* margins are required by official ORCID trademark and display guidelines */ + margin-left:4px; + margin-right:4px; + vertical-align: middle; +} + +/* Reference index & topics ----------------------------------------------- */ + +.ref-index th {font-weight: normal;} + +.ref-index td {vertical-align: top;} +.ref-index .icon {width: 40px;} +.ref-index .alias {width: 40%;} +.ref-index-icons .alias {width: calc(40% - 40px);} +.ref-index .title {width: 60%;} + +.ref-arguments th {text-align: right; padding-right: 10px;} +.ref-arguments th, .ref-arguments td {vertical-align: top;} +.ref-arguments .name {width: 20%;} +.ref-arguments .desc {width: 80%;} + +/* Nice scrolling for wide elements --------------------------------------- */ + +table { + display: block; + overflow: auto; +} + +/* Syntax highlighting ---------------------------------------------------- */ + +pre { + word-wrap: normal; + word-break: normal; + border: 1px solid #eee; +} + +pre, code { + background-color: #f8f8f8; + color: #333; +} + +pre code { + overflow: auto; + word-wrap: normal; + white-space: pre; +} + +pre .img { + margin: 5px 0; +} + +pre .img img { + background-color: #fff; + display: block; + height: auto; +} + +code a, pre a { + color: #375f84; +} + +a.sourceLine:hover { + text-decoration: none; +} + +.fl {color: #1514b5;} +.fu {color: #000000;} /* function */ +.ch,.st {color: #036a07;} /* string */ +.kw {color: #264D66;} /* keyword */ +.co {color: #888888;} /* comment */ + +.message { color: black; font-weight: bolder;} +.error { color: orange; font-weight: bolder;} +.warning { color: #6A0366; font-weight: bolder;} + +/* Clipboard --------------------------*/ + +.hasCopyButton { + position: relative; +} + +.btn-copy-ex { + position: absolute; + right: 0; + top: 0; + visibility: hidden; +} + +.hasCopyButton:hover button.btn-copy-ex { + visibility: visible; +} + +/* headroom.js ------------------------ */ + +.headroom { + will-change: transform; + transition: transform 200ms linear; +} +.headroom--pinned { + transform: translateY(0%); +} +.headroom--unpinned { + transform: translateY(-100%); +} + +/* mark.js ----------------------------*/ + +mark { + background-color: rgba(255, 255, 51, 0.5); + border-bottom: 2px solid rgba(255, 153, 51, 0.3); + padding: 1px; +} + +/* vertical spacing after htmlwidgets */ +.html-widget { + margin-bottom: 10px; +} + +/* fontawesome ------------------------ */ + +.fab { + font-family: "Font Awesome 5 Brands" !important; +} + +/* don't display links in code chunks when printing */ +/* source: https://stackoverflow.com/a/10781533 */ +@media print { + code a:link:after, code a:visited:after { + content: ""; + } +} diff --git a/docs/pkgdown.js b/docs/pkgdown.js new file mode 100644 index 0000000..087a762 --- /dev/null +++ b/docs/pkgdown.js @@ -0,0 +1,113 @@ +/* http://gregfranko.com/blog/jquery-best-practices/ */ +(function($) { + $(function() { + + $('.navbar-fixed-top').headroom(); + + $('body').css('padding-top', $('.navbar').height() + 10); + $(window).resize(function(){ + $('body').css('padding-top', $('.navbar').height() + 10); + }); + + $('body').scrollspy({ + target: '#sidebar', + offset: 60 + }); + + $('[data-toggle="tooltip"]').tooltip(); + + var cur_path = paths(location.pathname); + var links = $("#navbar ul li a"); + var max_length = -1; + var pos = -1; + for (var i = 0; i < links.length; i++) { + if (links[i].getAttribute("href") === "#") + continue; + // Ignore external links + if (links[i].host !== location.host) + continue; + + var nav_path = paths(links[i].pathname); + + var length = prefix_length(nav_path, cur_path); + if (length > max_length) { + max_length = length; + pos = i; + } + } + + // Add class to parent
  • , and enclosing
  • if in dropdown + if (pos >= 0) { + var menu_anchor = $(links[pos]); + menu_anchor.parent().addClass("active"); + menu_anchor.closest("li.dropdown").addClass("active"); + } + }); + + function paths(pathname) { + var pieces = pathname.split("/"); + pieces.shift(); // always starts with / + + var end = pieces[pieces.length - 1]; + if (end === "index.html" || end === "") + pieces.pop(); + return(pieces); + } + + // Returns -1 if not found + function prefix_length(needle, haystack) { + if (needle.length > haystack.length) + return(-1); + + // Special case for length-0 haystack, since for loop won't run + if (haystack.length === 0) { + return(needle.length === 0 ? 0 : -1); + } + + for (var i = 0; i < haystack.length; i++) { + if (needle[i] != haystack[i]) + return(i); + } + + return(haystack.length); + } + + /* Clipboard --------------------------*/ + + function changeTooltipMessage(element, msg) { + var tooltipOriginalTitle=element.getAttribute('data-original-title'); + element.setAttribute('data-original-title', msg); + $(element).tooltip('show'); + element.setAttribute('data-original-title', tooltipOriginalTitle); + } + + if(ClipboardJS.isSupported()) { + $(document).ready(function() { + var copyButton = ""; + + $(".examples, div.sourceCode").addClass("hasCopyButton"); + + // Insert copy buttons: + $(copyButton).prependTo(".hasCopyButton"); + + // Initialize tooltips: + $('.btn-copy-ex').tooltip({container: 'body'}); + + // Initialize clipboard: + var clipboardBtnCopies = new ClipboardJS('[data-clipboard-copy]', { + text: function(trigger) { + return trigger.parentNode.textContent; + } + }); + + clipboardBtnCopies.on('success', function(e) { + changeTooltipMessage(e.trigger, 'Copied!'); + e.clearSelection(); + }); + + clipboardBtnCopies.on('error', function() { + changeTooltipMessage(e.trigger,'Press Ctrl+C or Command+C to copy'); + }); + }); + } +})(window.jQuery || window.$) diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml new file mode 100644 index 0000000..30a6d4b --- /dev/null +++ b/docs/pkgdown.yml @@ -0,0 +1,7 @@ +pandoc: 2.2.1 +pkgdown: 1.4.1 +pkgdown_sha: ~ +articles: + datapasta-in-the-cloud: datapasta-in-the-cloud.html + how-to-datapasta: how-to-datapasta.html + diff --git a/docs/reference/custom_context.html b/docs/reference/custom_context.html new file mode 100644 index 0000000..1fcf356 --- /dev/null +++ b/docs/reference/custom_context.html @@ -0,0 +1,207 @@ + + + + + + + + +custom_context — clipboard_context • datapasta + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    the _context functions define lists of parameters for text formatting. +The specific contexts return hard-coded values appropriate to the context they describe, while custom_context allows definition of new contexts for custom formatting.

    +
    + +
    clipboard_context()
    +
    +rstudio_context()
    +
    +console_context()
    +
    +markdown_context()
    +
    +custom_context(
    +  output_mode = "console",
    +  nspc = 2,
    +  indent_context = 0,
    +  indent_head = TRUE
    +)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + +
    output_mode

    A named output mode, controls the target of the _paste functions options are "rstudioapi" or "console"

    nspc

    The number of spaces for each indent level in the output context

    indent_context

    The number of spaces applied initially to all lines in the output context

    indent_head

    Logical. Apply the indent_context to the to the header row? Use FALSE if targeting cursor location.

    + +

    Value

    + +

    an output context. An input to _paste, _format, _construct functions used to format whitespace.

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/df_format.html b/docs/reference/df_format.html new file mode 100644 index 0000000..5bfdf46 --- /dev/null +++ b/docs/reference/df_format.html @@ -0,0 +1,184 @@ + + + + + + + + +df_format — df_format • datapasta + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Parse the current clipboard as a table and paste to the clipboard in data.frame format.

    +
    + +
    df_format(input_table, output_context = clipboard_context())
    + +

    Arguments

    + + + + + + + + + + +
    input_table

    an optional input tibble or data.frame to format.

    output_context

    an optional output context that defines the target and indentation.

    + +

    Value

    + +

    nothing.

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/df_paste.html b/docs/reference/df_paste.html new file mode 100644 index 0000000..04810d7 --- /dev/null +++ b/docs/reference/df_paste.html @@ -0,0 +1,185 @@ + + + + + + + + +df_paste — df_paste • datapasta + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Parse either: the current clipboard, or a supplied argument, as a table and paste in at the cursor location in data.frame format.

    +
    + +
    df_paste(input_table, output_context = guess_output_context())
    + +

    Arguments

    + + + + + + + + + + +
    input_table

    an optional input tibble or data.frame to format.

    output_context

    an optional output context that defines the target and indentation. +The default behaviour is target the rstudioapi and fall back to console if it is not available.

    + +

    Value

    + +

    nothing.

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/dfdt_construct.html b/docs/reference/dfdt_construct.html new file mode 100644 index 0000000..f0ae639 --- /dev/null +++ b/docs/reference/dfdt_construct.html @@ -0,0 +1,188 @@ + + + + + + + + +dfdt_construct — dfdt_construct • datapasta + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Parse the current clipboard as a table and return in data.frame format.

    +
    + +
    dfdt_construct(input_table, oc = console_context(), class = NULL)
    + +

    Arguments

    + + + + + + + + + + + + + + +
    input_table

    an optional R object to parse instead of the clipboard.

    oc

    an optional output context that defines the target and indentation.

    class

    either data.frame or data.table.

    + +

    Value

    + +

    a character string containing the input formatted as a data.frame definition.

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/dmdclip.html b/docs/reference/dmdclip.html new file mode 100644 index 0000000..1227bb0 --- /dev/null +++ b/docs/reference/dmdclip.html @@ -0,0 +1,180 @@ + + + + + + + + +dmdclip — dmdclip • datapasta + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Formats input for presentation in markdown as a preformatted chunk and inserts it onto the clipboard. Ready for pasting to Stack Overflow or Github.

    +
    + +
    dmdclip(input)
    + +

    Arguments

    + + + + + + +
    input

    a vector, data.frame, or tibble

    + +

    Value

    + +

    nothing

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/dp_set_decimal_mark.html b/docs/reference/dp_set_decimal_mark.html new file mode 100644 index 0000000..53a43fd --- /dev/null +++ b/docs/reference/dp_set_decimal_mark.html @@ -0,0 +1,182 @@ + + + + + + + + +dp_set_decimal_mark — dp_set_decimal_mark • datapasta + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    A function to optionally set the decimal mark if in a locale where it is not `.`. Will allow "3,14" to be parsed as 3.14, normally would be parsed as 314. +Will also handle spaces in numbers.

    +
    + +
    dp_set_decimal_mark(mark)
    + +

    Arguments

    + + + + + + +
    mark

    The decimal mark to use when parsing "number" type data, as guessed by readr::guess_parser.

    + +

    Value

    + +

    NULL.

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/dp_set_max_rows.html b/docs/reference/dp_set_max_rows.html new file mode 100644 index 0000000..3280417 --- /dev/null +++ b/docs/reference/dp_set_max_rows.html @@ -0,0 +1,176 @@ + + + + + + + + +dp_set_max_rows — dp_set_max_rows • datapasta + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    dp_set_max_rows

    +
    + +
    dp_set_max_rows(num_rows)
    + +

    Arguments

    + + + + + + +
    num_rows

    The number of rows of an input at which any of tribble_construct() or df_construct() will abort parsing. Datapasta is untested on large tables. Use at own risk.

    + + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/dpasta.html b/docs/reference/dpasta.html new file mode 100644 index 0000000..f01ff02 --- /dev/null +++ b/docs/reference/dpasta.html @@ -0,0 +1,180 @@ + + + + + + + + +dpasta — dpasta • datapasta + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Formats input and inserts at either the current cursor or the console.

    +
    + +
    dpasta(input)
    + +

    Arguments

    + + + + + + +
    input

    a vector, data.frame, or tibble

    + +

    Value

    + +

    nothing

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/dt_format.html b/docs/reference/dt_format.html new file mode 100644 index 0000000..d3a0e69 --- /dev/null +++ b/docs/reference/dt_format.html @@ -0,0 +1,184 @@ + + + + + + + + +dt_format — dt_format • datapasta + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Parse the current clipboard as a table and paste to the clipboard in data.table format.

    +
    + +
    dt_format(input_table, output_context = clipboard_context())
    + +

    Arguments

    + + + + + + + + + + +
    input_table

    an optional input tibble or data.frame to format.

    output_context

    an optional output context that defines the target and indentation.

    + +

    Value

    + +

    nothing.

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/dt_paste.html b/docs/reference/dt_paste.html new file mode 100644 index 0000000..b6f44d2 --- /dev/null +++ b/docs/reference/dt_paste.html @@ -0,0 +1,185 @@ + + + + + + + + +dt_paste — dt_paste • datapasta + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Parse either: the current clipboard, or a supplied argument, as a table and paste in at the cursor location in data.table format.

    +
    + +
    dt_paste(input_table, output_context = guess_output_context())
    + +

    Arguments

    + + + + + + + + + + +
    input_table

    an optional input tibble or data.frame to format.

    output_context

    an optional output context that defines the target and indentation. +The default behaviour is target the rstudioapi and fall back to console if it is not available.

    + +

    Value

    + +

    nothing.

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/guess_output_context.html b/docs/reference/guess_output_context.html new file mode 100644 index 0000000..845d743 --- /dev/null +++ b/docs/reference/guess_output_context.html @@ -0,0 +1,171 @@ + + + + + + + + +guess_output_context — guess_output_context • datapasta + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Return the a list containing the guessed output target context, either rstudio or the console.

    +
    + +
    guess_output_context()
    + + +

    Value

    + +

    a list containing the output target, space size of indent, and number of indents at context.

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/guess_sep.html b/docs/reference/guess_sep.html new file mode 100644 index 0000000..bb45559 --- /dev/null +++ b/docs/reference/guess_sep.html @@ -0,0 +1,186 @@ + + + + + + + + +guess_sep — guess_sep • datapasta + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Guesses the separator based on a simple heuristic over the first 10 or less rows: +The separator chosen is the one that leads to the most columns, whilst parsing the same number of columns for each line (var=0). +The guessing algorithm ignores blank lines - which are lines that contain only the separator. +Options are in `c(",","\t","\|",";")`

    +
    + +
    guess_sep(char_vec)
    + +

    Arguments

    + + + + + + +
    char_vec

    a table from the clipboard in character vector form.

    + +

    Value

    + +

    the separator selected to parse char_vec as a table

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/index.html b/docs/reference/index.html new file mode 100644 index 0000000..60ccd10 --- /dev/null +++ b/docs/reference/index.html @@ -0,0 +1,297 @@ + + + + + + + + +Function reference • datapasta + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +

    Data pasting functions

    +

    The good stuff. All of these have RStudio addin bindings.

    +
    +

    tribble_paste()

    +

    tribble_paste

    +

    vector_paste()

    +

    vector_paste

    +

    vector_paste_vertical()

    +

    vector_paste_vertical

    +

    df_paste()

    +

    df_paste

    +

    dt_paste()

    +

    dt_paste

    +

    Data formatting functions

    +

    Send data formatted as code to the clipboard instead of automatically pasting.

    +
    +

    tribble_format()

    +

    tribble_format

    +

    vector_format()

    +

    vector_format

    +

    vector_format_vertical()

    +

    vector_format_vertical

    +

    df_format()

    +

    df_format

    +

    dt_format()

    +

    dt_format

    +

    Data returning functions

    +

    Return data formatted as code as a character vector.

    +
    +

    tribble_construct()

    +

    tribble_construct

    +

    vector_construct()

    +

    vector_construct

    +

    vector_construct_vertical()

    +

    vector_construct_vertical

    +

    dfdt_construct()

    +

    dfdt_construct

    +

    Configuration functions

    +

    Change the behaviour of datapasta.

    +
    +

    dp_set_max_rows()

    +

    dp_set_max_rows

    +

    dp_set_decimal_mark()

    +

    dp_set_decimal_mark

    +
    + + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/nchar_type.html b/docs/reference/nchar_type.html new file mode 100644 index 0000000..3502873 --- /dev/null +++ b/docs/reference/nchar_type.html @@ -0,0 +1,184 @@ + + + + + + + + +nchar_type — nchar_type • datapasta + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    nchar_type

    +
    + +
    nchar_type(df_col_row, df_col_type)
    + +

    Arguments

    + + + + + + + + + + +
    df_col_row

    a character string

    df_col_type

    the type the string will be converted to.

    + +

    Value

    + +

    The number of characters wide this data would be in when rendered in text

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/nquote_str.html b/docs/reference/nquote_str.html new file mode 100644 index 0000000..40d91a3 --- /dev/null +++ b/docs/reference/nquote_str.html @@ -0,0 +1,180 @@ + + + + + + + + +Count the number of quotes in a string — nquote_str • datapasta + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Count the number of quotes in a string

    +
    + +
    nquote_str(char_vec)
    + +

    Arguments

    + + + + + + +
    char_vec

    the string to count quotes in

    + +

    Value

    + +

    a number, possibly 0.

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/pad_to.html b/docs/reference/pad_to.html new file mode 100644 index 0000000..fcf63ba --- /dev/null +++ b/docs/reference/pad_to.html @@ -0,0 +1,184 @@ + + + + + + + + +pad_to — pad_to • datapasta + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Left pad string to a certain size. A helper function for getting spacing in table correct.

    +
    + +
    pad_to(char_vec, char_length)
    + +

    Arguments

    + + + + + + + + + + +
    char_vec

    character vector.

    char_length

    length to pad to.

    + +

    Value

    + +

    char_vec left-padded with spaces to char_length.

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/parse_vector.html b/docs/reference/parse_vector.html new file mode 100644 index 0000000..ed89986 --- /dev/null +++ b/docs/reference/parse_vector.html @@ -0,0 +1,183 @@ + + + + + + + + +parse_vector — parse_vector • datapasta + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Pastes data from clipboard as a vertically formatted character vector on +multiple lines. One line is used per element. Considers `,`, `tab`, `newline` as delimiters.

    +
    + +
    parse_vector(input_vector)
    + +

    Arguments

    + + + + + + +
    input_vector

    an optional character vector to attempt to break up, and escape.

    + +

    Value

    + +

    A vector parsed from the clipboard as ether a character string or a +character vector. The type attribute contains the type guessed by `readr`.

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/read_clip_tbl_guess.html b/docs/reference/read_clip_tbl_guess.html new file mode 100644 index 0000000..9dccf02 --- /dev/null +++ b/docs/reference/read_clip_tbl_guess.html @@ -0,0 +1,188 @@ + + + + + + + + +read_clip_table_guess — read_clip_tbl_guess • datapasta + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Similar to read_clip_tbl from clipr, +however it will error if there are less than 2 rows +and it tries to guess the separator.

    +
    + +
    read_clip_tbl_guess(x = NULL, ...)
    + +

    Arguments

    + + + + + + + + + + +
    x

    contents of the clipboard

    ...

    arguments passed to read.table

    + +

    Value

    + +

    a parsed table from the clipboard. Separator is guessed.

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/render_type.html b/docs/reference/render_type.html new file mode 100644 index 0000000..cb6cc53 --- /dev/null +++ b/docs/reference/render_type.html @@ -0,0 +1,187 @@ + + + + + + + + +render_type — render_type • datapasta + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Renders a character vector as R types for pasting into Rstudio. +Strings are quoted. Numbers, NA, logicals etc are not.

    +
    + +
    render_type(char_vec, char_type)
    + +

    Arguments

    + + + + + + + + + + +
    char_vec

    a character vector containing text to be rendered as the type indicated by type_str

    char_type

    a string describing the type of char_vec

    + +

    Value

    + +

    A vector parsed from the clipboard as ether a character string or a +character vector. The type attribute contains the type guessed by `readr`.

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/render_type_pad_to.html b/docs/reference/render_type_pad_to.html new file mode 100644 index 0000000..2e32300 --- /dev/null +++ b/docs/reference/render_type_pad_to.html @@ -0,0 +1,191 @@ + + + + + + + + +render_type_pad_to — render_type_pad_to • datapasta + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Based on a type and length, render a character string as the type in text. +Pad to the desired length.

    +
    + +
    render_type_pad_to(char_vec, char_type, char_length)
    + +

    Arguments

    + + + + + + + + + + + + + + +
    char_vec

    a character vector

    char_type

    a string type from readr::guess_parser

    char_length

    a string length to pad to.

    + +

    Value

    + +

    a string containing the representation of char_vec as char_type in the RStudio source editor, +left-padded with spaces to char_length.

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/tortellini.html b/docs/reference/tortellini.html new file mode 100644 index 0000000..6395b39 --- /dev/null +++ b/docs/reference/tortellini.html @@ -0,0 +1,192 @@ + + + + + + + + +wrap the datapasta around itself — tortellini • datapasta + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    wrap the datapasta around itself

    +
    + +
    tortellini(col_struct, defn_width = 80, indent_context = 0, add_comma = TRUE)
    + +

    Arguments

    + + + + + + + + + + + + + + + + + + +
    col_struct

    input structure - a split apart column definition

    defn_width

    total number of characters in a line (includes column name and indent on line 1)

    indent_context

    the level of indent in spaces in the current editor pane

    add_comma

    add one final comma to the end of the wrapped column def? Useful when pasting together columns.

    + +

    Value

    + +

    w wrapped string

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/tribble_construct.html b/docs/reference/tribble_construct.html new file mode 100644 index 0000000..f0d368c --- /dev/null +++ b/docs/reference/tribble_construct.html @@ -0,0 +1,185 @@ + + + + + + + + +tribble_construct — tribble_construct • datapasta + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Parse the current clipboard as a table, or use the table argument supplied, and return as a character string.

    +
    + +
    tribble_construct(input_table, oc = console_context())
    + +

    Arguments

    + + + + + + + + + + +
    input_table

    an optional input `data.frame`. If `input_table` is supplied, then nothing is read from the clipboard.

    oc

    an optional output context that defines the target and indentation. Default is console. +Table is output as `tribble()` call. Useful for creating reproducible examples.

    + +

    Value

    + +

    The parsed table text.

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/tribble_format.html b/docs/reference/tribble_format.html new file mode 100644 index 0000000..d2e0c75 --- /dev/null +++ b/docs/reference/tribble_format.html @@ -0,0 +1,185 @@ + + + + + + + + +tribble_format — tribble_format • datapasta + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Parse the current clipboard as a table, or use the table argument supplied, and paste to the clipboard in tribble format.

    +
    + +
    tribble_format(input_table, output_context = console_context())
    + +

    Arguments

    + + + + + + + + + + +
    input_table

    an optional input `data.frame`. If `input_table` is supplied, then nothing is read from the clipboard.

    output_context

    an optional output context that defines the target and indentation. Default is console. +Table is output as `tribble()` call. Useful for creating reproducible examples.

    + +

    Value

    + +

    Nothing.

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/tribble_paste.html b/docs/reference/tribble_paste.html new file mode 100644 index 0000000..b2317d7 --- /dev/null +++ b/docs/reference/tribble_paste.html @@ -0,0 +1,185 @@ + + + + + + + + +tribble_paste — tribble_paste • datapasta + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Parse the current clipboard as a table, or use the table argument supplied, and paste in at the cursor location in tribble format.

    +
    + +
    tribble_paste(input_table, output_context = guess_output_context())
    + +

    Arguments

    + + + + + + + + + + +
    input_table

    an optional input `data.frame`. If `input_table` is supplied, then nothing is read from the clipboard.

    output_context

    an optional output context that defines the target and indentation. Default is to guess between rstudio and console. +Table is output as `tribble()` call. Useful for creating reproducible examples.

    + +

    Value

    + +

    Nothing.

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/vector_construct.html b/docs/reference/vector_construct.html new file mode 100644 index 0000000..13844ad --- /dev/null +++ b/docs/reference/vector_construct.html @@ -0,0 +1,186 @@ + + + + + + + + +vector_construct — vector_construct • datapasta + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Returns a formatted character string, either from clipboard or supplied argument, as a vector definition. Considers `,`, `tab`, `newline` as delimiters. +If a single character string is passed as an argument, it will be split to form a vector.

    +
    + +
    vector_construct(input_vector, oc = console_context())
    + +

    Arguments

    + + + + + + + + + + +
    input_vector

    An input vector to be formatted for output. If supplied, no data is read from the clipboard.

    oc

    an optional output context that defines the output indentation.

    + +

    Value

    + +

    A string containing the input formatted as a vector definition.

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/vector_construct_vertical.html b/docs/reference/vector_construct_vertical.html new file mode 100644 index 0000000..c1d71f1 --- /dev/null +++ b/docs/reference/vector_construct_vertical.html @@ -0,0 +1,187 @@ + + + + + + + + +vector_construct_vertical — vector_construct_vertical • datapasta + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Returns a formatted string, either from clipboard or supplied argument, as a vertically formatted character vector over many lines. +Considers `,`, `tab`, `newline` as delimiters. If a single character string is passed as an argument, it will be split to form a vector.

    +
    + +
    vector_construct_vertical(input_vector, oc = console_context())
    + +

    Arguments

    + + + + + + + + + + +
    input_vector

    An input vector to be formatted for output. If supplied, no data is read from the clipboard.

    oc

    an optional output context that defines the output target and indentation. +The default behaviour is to target the rstudioapi and fall back to console if it is not available.

    + +

    Value

    + +

    a string containing the input formatted as a vector definition.

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/vector_format.html b/docs/reference/vector_format.html new file mode 100644 index 0000000..d7c4b92 --- /dev/null +++ b/docs/reference/vector_format.html @@ -0,0 +1,186 @@ + + + + + + + + +vector_format — vector_format • datapasta + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Writes data to the clipboard, either from clipboard or supplied argument. Writes a horizontally formatted character vector on +a single line. Considers `,`, `tab`, `newline` as delimiters. If a single character string is passed as an argument, it will be split to form a vector.

    +
    + +
    vector_format(input_vector, output_context = console_context())
    + +

    Arguments

    + + + + + + + + + + +
    input_vector

    An input vector to be formatted for output. If supplied, no data is read from the clipboard.

    output_context

    an optional output context that defines the output indentation.

    + +

    Value

    + +

    nothing.

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/vector_format_vertical.html b/docs/reference/vector_format_vertical.html new file mode 100644 index 0000000..9859774 --- /dev/null +++ b/docs/reference/vector_format_vertical.html @@ -0,0 +1,187 @@ + + + + + + + + +vector_format_vertical — vector_format_vertical • datapasta + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Writes data to clipboard, either from clipboard or supplied argument, as a vertically formatted character vector over many lines. +Considers `,`, `tab`, `newline` as delimiters. If a single character string is passed as an argument, it will be split to form a vector.

    +
    + +
    vector_format_vertical(input_vector, output_context = clipboard_context())
    + +

    Arguments

    + + + + + + + + + + +
    input_vector

    An input vector to be formatted for output. If supplied, no data is read from the clipboard.

    output_context

    an optional output context that defines the output target and indentation. +The default behaviour is to target the rstudioapi and fall back to console if it is not available.

    + +

    Value

    + +

    nothing.

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/vector_paste.html b/docs/reference/vector_paste.html new file mode 100644 index 0000000..ea56461 --- /dev/null +++ b/docs/reference/vector_paste.html @@ -0,0 +1,187 @@ + + + + + + + + +vector_paste — vector_paste • datapasta + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Pastes data, either from clipboard or supplied argument, as a horizontally formatted character vector on +a single line. Considers `,`, `tab`, `newline` as delimiters. If a single character string is passed as an argument, it will be split to form a vector.

    +
    + +
    vector_paste(input_vector, output_context = guess_output_context())
    + +

    Arguments

    + + + + + + + + + + +
    input_vector

    An input vector to be formatted for output. If supplied, no data is read from the clipboard.

    output_context

    an optional output context that defines the output target and indentation. +The default behaviour is to target the rstudioapi and fall back to console if it is not available.

    + +

    Value

    + +

    nothing.

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/vector_paste_vertical.html b/docs/reference/vector_paste_vertical.html new file mode 100644 index 0000000..288aef4 --- /dev/null +++ b/docs/reference/vector_paste_vertical.html @@ -0,0 +1,185 @@ + + + + + + + + +vector_paste_vertical — vector_paste_vertical • datapasta + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    Pastes data, either from clipboard or supplied argument, as a vertically formatted character vector over many lines. Considers `,`, `tab`, `newline` as delimiters. If a single character string is passed as an argument, it will be split to form a vector.

    +
    + +
    vector_paste_vertical(input_vector, output_context = guess_output_context())
    + +

    Arguments

    + + + + + + + + + + +
    input_vector

    An input vector to be formatted for output. If supplied, no data is read from the clipboard.

    output_context

    an optional output context that defines the output target and indentation. +The default behaviour is to target the rstudioapi and fall back to console if it is not available.

    + +

    Value

    + +

    nothing.

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/zzz_rs_dfiddle.html b/docs/reference/zzz_rs_dfiddle.html new file mode 100644 index 0000000..ad03040 --- /dev/null +++ b/docs/reference/zzz_rs_dfiddle.html @@ -0,0 +1,177 @@ + + + + + + + + +dfiddle — zzz_rs_dfiddle • datapasta + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    An addin to fiddle your RStudio selections to better things. +Make a selection in RStudio and dfiddle will update it inline. Good for: +Converting Text to vectors (`c()`), pivoting between horizontal and vertical vectors, +reflowing tribble() and data.frame() definitions to have nice indenting and padding.

    +
    + +
    zzz_rs_dfiddle()
    + + +

    Value

    + +

    a fiddled version of your selection (invisibly)

    + +
    + +
    + + +
    + + +
    +

    Site built with pkgdown 1.4.1.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/reference/zzz_rs_toggle_quotes.html b/docs/reference/zzz_rs_toggle_quotes.html new file mode 100644 index 0000000..d1aa55b --- /dev/null +++ b/docs/reference/zzz_rs_toggle_quotes.html @@ -0,0 +1,173 @@ + + + + + + + + +Toggle Quotes — zzz_rs_toggle_quotes • datapasta + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + +
    +

    An addin to toggle between quotes and bare vectors. Applies to a vector selected +in an RStudio source editor. Works with horizontal or vertical form.

    +
    + +
    zzz_rs_toggle_quotes()
    + + +

    Value

    + +

    The toggled vector (invisibly).

    + +
    + +
    + + + +
    + + + + + + + + diff --git a/vignettes/datapasta-in-the-cloud.Rmd b/vignettes/datapasta-in-the-cloud.Rmd index 00d47b1..5059b39 100644 --- a/vignettes/datapasta-in-the-cloud.Rmd +++ b/vignettes/datapasta-in-the-cloud.Rmd @@ -66,7 +66,5 @@ The first time the pop-up text editor is about to be opened in each session, happen. This can be disabled with: ```{R eval = FALSE} - options(datapasta.quiet_manual_paste = TRUE) - ```