Dear list,

I am trying to import 25-75 lightning flash days (point pattern data with
1000-3600 entries per object-- the data is being exported from Access) and
then trying to plot(allstats(data)) to interrupt clusters and other events.
I am trying to run two loops, one for the import, and one for the plotting,
but here are the following issues I've encountered:

#Trying Baptiste's importing code
assignFiles <-
+ function (pattern = "dbf", strip = ".dbf") # strip is any pattern you want
to remove from the filenames {
+      listFiles <- list.files(pattern = pattern, all.files = FALSE,
+          full.names = FALSE, recursive = FALSE)
>      variables <- gsub(strip, "", listFiles)
>      for (ii in (1:length(listFiles))) {
+          name <- listFiles[ii]
+          assign(variables[ii], read.dbf(name), env = .GlobalEnv)
+      }
Error in get("read.dbf", "package:foreign")(dbf.name) :
  unable to open DBF file


## Trying Romaine's importing code
 files <- dir( pattern = "\\.txt$" )
 for( x in files){
 assign( sub( "\\.txt$", "", x ) , read.csv(x), envir = .GlobalEnv )
 }

#Prep code and loop
 test=ls(pattern="_")
for (i in 1:length(test))
{
ppptest=ppp(test[i]$LONG, test[i]$LAT, window=owin(range(test[i]$LONG),
range(test[i]$LAT)))
dev.new(); plot(allstats(ppptest))
}
Error in test[i]$LONG : $ operator is invalid for atomic vectors

##Even if I manually select the date file that is imported using Romaine's
code above, I receive this error:

> May_22_2004ppp=ppp(May_22_2004$LONG, May_22_2004$LAT, window=gwin_owin)
Error: is.numeric(x) is not TRUE
> May_22_2004=as.numeric(May_22_2004)
Error: (list) object cannot be coerced to type 'double'
> May_22_2004ppp=ppp(May_22_2004$LONG, May_22_2004$LAT, window=gwin_owin)
Error: is.numeric(x) is not TRUE

####--- So basically I need a way to import a csv or dbf or txt in an
automated manner where the LAT LONG remains numeric (Access has these fields
as numbers). And then I need a manner of creating a list of these importing
dates [ ls(pattern="_") would give me all the days, but as characters, not a
list of vectors- I believe] so that I can run a plotting loop.

In other words, this is what I want to run on a large, automated scale:

july19=read.dbf(file.choose())
july19.ppp=ppp(july19$LONG, july19$LAT, window=owin(range(july19$LONG),
range(july19$LAT)), marks=july19$KA)
july19.ppp.u=unmark(july19.ppp)
plot(allstats(july19.ppp.u))
plot(pcf(july19.ppp));dev.new();plot(Gest(july19.ppp))


Thanks for any ideas or suggestions!!!

Ona

-- 
Ona Strikas
PhD Program
Department of Geography
Florida State University
Bellamy Bldg Room 323
Office: 201 Bellamy

	[[alternative HTML version deleted]]

