All Projects → MilesMcBain → Datapasta

MilesMcBain / Datapasta

Licence: other
On top of spaghetti, all covered in cheese....

Programming Languages

r
7636 projects

Projects that are alternatives of or similar to Datapasta

Reogrid
Fast and powerful .NET spreadsheet component, support data format, freeze, outline, formula calculation, chart, script execution and etc. Compatible with Excel 2007 (.xlsx) format and working on .NET 3.5 (or client profile), WPF and Android platform.
Stars: ✭ 532 (-24.43%)
Mutual labels:  excel
Sqlitebiter
A CLI tool to convert CSV / Excel / HTML / JSON / Jupyter Notebook / LDJSON / LTSV / Markdown / SQLite / SSV / TSV / Google-Sheets to a SQLite database file.
Stars: ✭ 601 (-14.63%)
Mutual labels:  excel
Ce
Jspreadsheet is a lightweight vanilla javascript plugin to create amazing web-based interactive tables and spreadsheets compatible with other spreadsheet software.
Stars: ✭ 5,832 (+728.41%)
Mutual labels:  excel
Formula Parser
Javascript Library parsing Excel Formulas and more
Stars: ✭ 544 (-22.73%)
Mutual labels:  excel
Readxl
Read excel files (.xls and .xlsx) into R 🖇
Stars: ✭ 585 (-16.9%)
Mutual labels:  excel
Ejsexcel
nodejs excel template engine. node export excel
Stars: ✭ 621 (-11.79%)
Mutual labels:  excel
Clipy
Clipboard extension app for macOS.
Stars: ✭ 5,574 (+691.76%)
Mutual labels:  clipboard
Epplus
EPPlus 5-Excel spreadsheets for .NET
Stars: ✭ 693 (-1.56%)
Mutual labels:  excel
Inlineattachment
Easily paste and upload files/images in plain textareas
Stars: ✭ 597 (-15.2%)
Mutual labels:  clipboard
Clipmenu
Clipboard management using dmenu
Stars: ✭ 634 (-9.94%)
Mutual labels:  clipboard
Excel2latex
The Excel add-in for creating LaTeX tables
Stars: ✭ 569 (-19.18%)
Mutual labels:  excel
Laracsv
A Laravel package to easily generate CSV files from Eloquent model
Stars: ✭ 583 (-17.19%)
Mutual labels:  excel
Dataproofer
A proofreader for your data
Stars: ✭ 628 (-10.8%)
Mutual labels:  excel
Irisadminapi
iris 框架的后台api项目
Stars: ✭ 544 (-22.73%)
Mutual labels:  excel
Calamine
A pure Rust Excel/OpenDocument SpeadSheets file reader: rust on metal sheets
Stars: ✭ 644 (-8.52%)
Mutual labels:  excel
Stock analysis for quant
Different Types of Stock Analysis in Python, R, Matlab, Excel, Power BI
Stars: ✭ 525 (-25.43%)
Mutual labels:  excel
Pbgopy
Copy and paste between devices
Stars: ✭ 612 (-13.07%)
Mutual labels:  clipboard
Sheetjs
📗 SheetJS Community Edition -- Spreadsheet Data Toolkit
Stars: ✭ 28,479 (+3945.31%)
Mutual labels:  excel
Xlsx Populate
Excel XLSX parser/generator written in JavaScript with Node.js and browser support, jQuery/d3-style method chaining, encryption, and a focus on keeping existing workbook features and styles in tact.
Stars: ✭ 668 (-5.11%)
Mutual labels:  excel
Pasteex
📋 Paste As File 把剪贴板的内容直接粘贴为文件
Stars: ✭ 634 (-9.94%)
Mutual labels:  clipboard

datapasta 3.1.1 'Leave to Simmer'

CRAN status. Downloads

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. Set the keyboard shortcuts using Tools -> Addins -> Browse Addins, then click Keyboard Shortcuts...

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 aligning 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:

  • install.packages("datapasta", dependencies = "Depends").
  • Followed by install.packages("clipr") to enable clipboard features.

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 eventually 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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].