I'm playing around with the
stars package (0.4-1) in R, but I can't get how to export a grid object in ASCII format, as the traditional
writeRaster(r, filename=file.path(dir.list[j], 'test.asc'), format="ascii") would do.
On one side I tried
write_stars(r, dsn=file.path(dir.list[j], 'test.asc'))
but I get
Error in CPL_write_gdal(mat, file, driver, options, type, dims, from, : driver not recognized.
On the other hand, if I try to convert it to a
RasterLayer using the provided function I get different errors:
r = as(r) Error in .identC(thisClass, Class) : "Class" is not specified and doesn't have a default value r = stars::as(r) Error: 'as' is not an object from 'namespace:stars'
The help page is not that helpful and I don't find any other info in the web.