An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20090320/0d16e904/attachment.pl>
delete shapefile in the directory
3 messages · gianni lavaredo, Agustin Lobo, Paul Hiemstra
system() lets you run any command on your OS Agus
gianni lavaredo wrote:
Hi all is there a code to delete shapefie in a directory? thanks Gianni [[alternative HTML version deleted]]
_______________________________________________ R-sig-Geo mailing list R-sig-Geo at stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo
-------------- next part -------------- A non-text attachment was scrubbed... Name: alobolistas.vcf Type: text/x-vcard Size: 251 bytes Desc: not available URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20090320/43f46e69/attachment.vcf>
2 days later
Hi,
You can also use the command file.remove. The advantage of using this
command in stead of the system call that Agustin suggested is that the
code will work on all OS'es. If you use a call like system("rm
/foo/bar") this works on Linux but not on Windows.
In addition, shapefiles are ofcourse a collection of files. You can use
file.remove in combination with list.files to delete all the files that
form a shapefile. If the base name of the shapefile is foo_bar:
file.remove(list.files(pattern="foo_bar"))
cheers
Paul
Agustin Lobo wrote:
system() lets you run any command on your OS Agus gianni lavaredo wrote:
Hi all
is there a code to delete shapefie in a directory?
thanks
Gianni
[[alternative HTML version deleted]]
_______________________________________________ R-sig-Geo mailing list R-sig-Geo at stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo
_______________________________________________ R-sig-Geo mailing list R-sig-Geo at stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Drs. Paul Hiemstra Department of Physical Geography Faculty of Geosciences University of Utrecht Heidelberglaan 2 P.O. Box 80.115 3508 TC Utrecht Phone: +3130 274 3113 Mon-Tue Phone: +3130 253 5773 Wed-Fri http://intamap.geo.uu.nl/~paul