File: rquery.R

package info (click to toggle)
epigrass 2.5.0+dfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 10,980 kB
  • sloc: python: 4,742; makefile: 83
file content (19 lines) | stat: -rw-r--r-- 682 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#Query to Epigrass database to fetch simulation results

library(DBI)
library(RMySQL)
library(lattice)

drv <- dbDriver("MySQL")
con <- dbConnect(drv, username='root',password='mysql', host='localhost',dbname='epigrass')
listTBL <- dbListTables(con)

results<- dbReadTable(con,listTBL[4])
names(results)
par(mfrow=c(2,2))
plot(results$I[results$geocode==230440005],type='l',main='Fortaleza')
plot(results$I[results$geocode==355030800],type='l',main='S�o Paulo')
plot(results$I[results$geocode==520880605],type='l',main='goianira')
plot(results$I[results$geocode==510760205],type='l',main='Rondon�polis')
x11()
xyplot(I~as.numeric(time),type="l",groups=results$geocode,data=results)