[R] ESRI shape file import and time-space models

david.whiting@ncl.ac.uk david.whiting at ncl.ac.uk
Fri Feb 14 05:20:06 CET 2003


On Thu, Feb 13, 2003 at 12:36:51PM +0100, Ekkehardt.Altpeter at bag.admin.ch wrote:
> Dear R user,
> 
> I am running R under Windows 2000.
> 
> I am looking for a routine for importing
> 
> -        shape files (ESRI) into R
> 
> -        dbase files (FOXPRO) into R

I assume that as you say dbase (Foxpro) you mean Foxpro version < 3.0,
e.g. 2.x.  I don't know of a way of opening dbase/foxpro files from
within R (I think I saw once that RODBC can connect with dbase files,
and if it does I'm sure you'll hear from someone else who knows more
about it than me). 

If you have Foxpro and don't need an elegant solution, but just need to
get the job done then you can export files from foxpro as tab-delimited
files (COPY TO foxdata.txt DELIM WITH TAB) which you can then read into
R with:

dta <- read.delim("foxdata.txt", header=FALSE, sep="\t", strip.white =
TRUE)

This gets the data in, but does not give you the field names.  I have
written a little foxpro program that creates a tab-delimited file with
the headers (field names) that seems to work.  Again, I read the data
into R with read.delim(). Let me know if you want me to send you the
Foxpro program.

HTH,

Dave
 
-- 
Dave Whiting
Dar es Salaam, Tanzania




More information about the R-help mailing list