Easy download of asdar datasets

If you are looking for an easy way to download all the example data used Applied Spatial Data Analysis with R, this script was recently posted on the R-sig-Geo Mailing list by one of the book's authors, Roger Bivand.


#! /bin/bash
export ASDAR="http://www.asdar-book.org/"
export ASDAR_BUNDLES="${ASDAR}bundles"
CHAPTERS="hello cm vis die cm2 csdacm sppa geos lat1 lat2 dismap"
for ch in $CHAPTERS; do
if test -d ${ch}
then cd ${ch}
else
mkdir ${ch}
cd ${ch}
fi
wget -N "${ASDAR_BUNDLES}/${ch}_bundle.zip"
unzip -o "${ch}_bundle.zip"
cd ..
done

Simply save it as a shellscript, create a directory for the data, like ASDAR or alike and execute from there.

Note - if you are on Mac, here is a compiled version of wget for Leopard.

No TweetBacks yet. (Be the first to Tweet this post)

One thought on “Easy download of asdar datasets

Comments are closed.