Running examples in ‘RObsDat-Ex.R’ failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: RObsDat-package
> ### Title: R-Package to the observations Data Model from CUAHSI
> ### Aliases: RObsDat-package RObsDat
> ### Keywords: package
> 
> ### ** Examples
> 
> 	example(addDataValues)

addDtV> #connect to database
addDtV> getDefaultDB()
Loading required namespace: RSQLite

addDtV> ## Not run: 
addDtV> ##D #connect to postgreSQL database
addDtV> ##D require("RObsDat")
addDtV> ##D require("RPostgreSQL")
addDtV> ##D m <- dbDriver("PostgreSQL")
addDtV> ##D con <- dbConnect(m, user="a_user", password="secret", dbname="obsdat")
addDtV> ##D sqhandler <-  new("odm1_1Ver", con=con)
addDtV> ##D options(odm.handler=sqhandler)
addDtV> ##D 
addDtV> ##D #connect to MySQL database
addDtV> ##D require("RObsDat")
addDtV> ##D require("RMySQL")
addDtV> ##D m <- dbDriver("MySQL")
addDtV> ##D con <- dbConnect(m, user="a_user", password="secret", dbname="obsdat")
addDtV> ##D sqhandler <-  new("odm1_1Ver", con=con)
addDtV> ##D options(odm.handler=sqhandler)
addDtV> ##D 
addDtV> ##D #connect to SQLite database
addDtV> ##D require("RObsDat")
addDtV> ##D require("RSQLite")
addDtV> ##D m <- dbDriver("SQLite")
addDtV> ##D dbname = "database.db"
addDtV> ##D con <- dbConnect(m, dbname = dbname)
addDtV> ##D sqhandler <-  new("odm1_1Ver", con=con)
addDtV> ##D options(odm.handler=sqhandler)
addDtV> ##D 
addDtV> ## End(Not run)
addDtV> 
addDtV> #Store metadata in database
addDtV> addSite(Code="test", Name="Virtual test site", x=-5, y=46,
addDtV+ 	LatLongDatum="WGS84", Elevation=1500, State="Germany")
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries

addDtV> addVariable(Name="Distance", Unit="cm", ValueType="Field Observation",
addDtV+ 	GeneralCategory="Instrumentation", Code="test_dist")
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries

addDtV> addQualityControlLevel(ID=6,Code="test_ok", Definition="The default")
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries

addDtV> addISOMetadata(TopicCategory="Unknown", Title="Testdata",
addDtV+ 	Abstract="This data is created to test the functions of RObsDat")
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries

addDtV> addSource(Organization="Your Org", SourceDescription="Madeup data", 
addDtV+ 	SourceLink="RObsDat Documentation", ContactName="Yourself",
addDtV+ 	Metadata="Testdata")
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries

addDtV> library(xts)

addDtV> library(spacetime)

addDtV> example.data <- xts(1:40, seq(as.POSIXct("2014-01-01", tz="UTC"), 
addDtV+ 		as.POSIXct("2014-02-09", tz="UTC"), length.out=40))

addDtV> example.data[40] <- 30

addDtV> example.data[35] <- 22

addDtV> addDataValues(example.data[1:20], Site="Virtual test site", Variable="test_dist",  
addDtV+ 	Source="Madeup", QualityControlLevel="test_ok")
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries
Importing column  1 out of 1 
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries

addDtV> #Avoid duplicates automatically
addDtV> example.data[15] <- 30

addDtV> addDataValues(example.data, Site="Virtual test site", Variable="test_dist",  
addDtV+ 	Source="Madeup", QualityControlLevel="test_ok")
Importing column  1 out of 1 
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries

addDtV> inDB <- getDataValues(Site="test")

addDtV> stplot(inDB, mode="ts")

addDtV> #Version management
addDtV> inDB <- getDataValues(Site="test")

addDtV> to.correct <- which(inDB@data > 30)

addDtV> inDB@data[to.correct,] <- 20

addDtV> if(NROW(inDB@data)>=30){
addDtV+    inDB@data[30,] <- 32
addDtV+    updateDataValues(inDB, "Correction of wrong value")
addDtV+ }
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries
Warning in result_fetch(res@ptr, n = n) :
  Don't need to call dbFetch() for statements, only for queries
Error in if (is.na(the.vect[rownum])) { : the condition has length > 1
Calls: example ... IupdateDataValues -> IupdateDataValues -> .local -> paste -> sv
Execution halted