Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Class of returned object for path_tidy/new_fs_path #91
I was recently trying to switch my workflow from base functions to fs functions, and it works quite well, however some functions will fail when the value of fs function is given to them since they do not use method for the fs_path class. Here is an example where I store intermediate files as temporary ones in a raster workflow.
I'm not sure if this is an actual issue or not, since it is easily solved by wrapping it in as.character() function, so this is more like a feedback for the package API. I assume that there is a good reason for having the returned value as fs_path class (colors/encoding?!?), maybe a solution would be to have return as.character argument (would this break the consistency in returning the UTF path?!?).
Cheers and thanks for the work on this package!
Thanks, this was an issue with S4 dispatch and should now be fixed
raster::writeRaster(raster::raster(volcano), fs::file_temp()) #> class : RasterLayer #> dimensions : 87, 61, 5307 (nrow, ncol, ncell) #> resolution : 0.01639344, 0.01149425 (x, y) #> extent : 0, 1, 0, 1 (xmin, xmax, ymin, ymax) #> coord. ref. : NA #> data source : /private/var/folders/dt/r5s12t392tb5sk181j3gs4zw0000gn/T/RtmpFjgQwr/file1af473ce14e9.grd #> names : layer #> values : 94, 195 (min, max)
Created on 2018-03-20 by the reprex package (v0.2.0).