Learn R Programming

RSEIS (version 4.2-4)

getPDEcsv: Unpack PDE file

Description

Unpack PDE file as CSV file or ascii screen dump

Usage

getPDEcsv(pde = 'filename')
getPDEscreen(pde = 'filename' )

Value

list of locations, times and magnitude

Arguments

pde

character, file name

Author

Jonathan M. Lees<jonathan.lees@unc.edu>

Details

Download pde from: http://neic.usgs.gov/neis/epic/epic.html. csv version uses comma separated values. screen versions uses the screen dump and a parser

References

http://neic.usgs.gov/neis/epic/epic.html

Examples

Run this code
######  copy/paste  from the screen dump at the NEIC web site

fn <- tempfile()
K = c(
' PDE-Q  2008  12 31 053408.80  40.11  -77.00   1  2.4 LgGS    ... ....... ',      
' PDE-Q  2008  12 31 084757.50  46.75  154.41  14  4.9 mbGS    ... ....... ',       
' PDE-Q  2008  12 31 090228     44.53 -110.36   4  3.6 MLSLC   ... ....... ',      
' PDE-Q  2008  12 31 110505     33.94 -118.78  14  3.1 MLPAS   2F. ....... ',       
' PDE-Q  2008  12 31 113957.56   4.91  127.43  77  5.4 MwGS    ..M ....... ',       
' PDE-Q  2008  12 31 140227.55 -25.35 -177.61 154  5.3 MwGS    ..M ....... ')      

cat(file=fn, K, sep='\n')

### check: z = scan(file=fn, what='', sep='\n')

 
g <- getPDEscreen(pde = fn)
   

Run the code above in your browser using DataLab