datapasta icon indicating copy to clipboard operation
datapasta copied to clipboard

dpasta support for sf objects?

Open zackarno opened this issue 3 years ago • 1 comments

Hi Miles,

First, I am big fan of your work an this package!

I've recently stumbled into a case where I was doing some spatial data processes and realized I could only create the issue using my custom data. It was not easily reproducible using built-in data sets. Therefore, I greatly reduced and simplified my spatial data set, but couldn't get dput or dpasta to copy the data into code in a way that worked as it usually does with dataframes, tibbles, or other formats. The data was linestrings which I know would require a lot more code than many other formats, but I was wondering if a.) sf/spatial data is supported by datapasta, b.) if so, is there some documentation on the best practice for doing this, c.) if not, do you have any other suggestions on how to do this.

In the case describe above I ended up uploading the simplified linestring sf object to my post as a .rds file, but it would be cool to use datapasta if possible next time!

zackarno avatar May 22 '21 01:05 zackarno

Hey,

Glad datapasta is working for you!

I think I usually use dput for this. It is really ugly but it gets the job done.

It's probably something I am unlikely to implement in datapasta. the tribble format just doesn't work well for things that aren't base data types. Even supporting dates is a challenge due to ways they continue to change in parsing upstream.

Miles

MilesMcBain avatar Jul 14 '21 04:07 MilesMcBain