Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for character representations of input #113

Open
jonocarroll opened this issue Aug 11, 2020 · 2 comments
Open

Support for character representations of input #113

jonocarroll opened this issue Aug 11, 2020 · 2 comments

Comments

@jonocarroll
Copy link
Contributor

x_construct currently works with either the clipboard, or an existing data.frame- or tibble-classed object. Should support for the character-representation of this data be included? e.g.

x <- "	Location	Min	Max
Rain.	Adelaide	–	15
Rain.	Elizabeth	–	15
Rain.	Glenelg	–	15
Rain.	Noarlunga	–	14
Rain.	Mount Barker	–	13"

This works in the pathway of

clipr::write_clip(content = x)
tribble_paste()

and that could be wrapped if the input_table is of class "character", or some more effort could go towards parsing the text internally and avoiding the clipboard altogether. As a bonus, this would help with unit testing and places where the clipboard is unavailable.

I can't find where it is, but I thought there was an RStudio Server workaround where the text was entered locally - it could help with that also.

@shahreyar-abeer
Copy link

Would love to see it sorted.

@MilesMcBain
Copy link
Owner

What sort of workflow does this facilitate?

Is this helpful?

library(readr)
library(datapasta)
readr::read_tsv("	Location	Min	Max
Rain.	Adelaide	–	15
Rain.	Elizabeth	–	15
Rain.	Glenelg	–	15
Rain.	Noarlunga	–	14
Rain.	Mount Barker	–	13") %>%
dpasta()
tibble::tribble(
        ~X1,      ~Location, ~Min, ~Max,
    "Rain.",     "Adelaide",  "–",   15,
    "Rain.",    "Elizabeth",  "–",   15,
    "Rain.",      "Glenelg",  "–",   15,
    "Rain.",    "Noarlunga",  "–",   14,
    "Rain.", "Mount Barker",  "–",   13
    )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants