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

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: Berman
> ### Title: Thermodynamic Properties of Minerals
> ### Aliases: Berman
> 
> ### ** Examples
> 
> ## Don't show: 
> reset()
reset: resetting "thermo" object
OBIGT: loading default database with 1940 aqueous, 3486 total species
> ## End(Don't show)
> # Other than the formula, the parameters aren't stored in
> # thermo()$OBIGT, so this shows NAs
> info(info("quartz", "cr"))
       name abbrv formula state  ref1 ref2       date  model E_units       G
1995 quartz    Qz    SiO2    cr Ber88 <NA> 2017-10-01 Berman       J -856288
           H     S       Cp     V  a  b  c  d  e  f lambda  T
1995 -910700 41.46 44.74227 22.69 NA NA NA NA NA NA     NA NA
> # Properties of alpha-quartz (aQz) at 298.15 K and 1 bar
> Berman("quartz")
       T P       G       H     S       Cp     V
1 298.15 1 -856287 -910700 41.46 44.74227 22.69
> # Gibbs energies of aQz and coesite at higher T and P
> T <- seq(200, 1300, 100)
> P <- seq(22870, 31900, length.out = length(T))
> G_aQz <- Berman("quartz", T = T, P = P)$G
> G_Cs <- Berman("coesite", T = T, P = P)$G
> # That is close to the univariant curve (Ber88 Fig. 4),
> # so the difference in G is close to 0
> DGrxn <- G_Cs - G_aQz
> all(abs(DGrxn) < 100)  # TRUE
[1] FALSE
> 
> # Make a P-T diagram for SiO2 minerals (Ber88 Fig. 4)
> basis(c("SiO2", "O2"), c("cr", "gas"))
     O Si ispecies logact state
SiO2 2  1     1956      0    cr
O2   2  0     2679      0   gas
> species(c("quartz", "quartz,beta", "coesite"), "cr")
  SiO2 O2 ispecies logact state        name
1    1  0     1995      0    cr      quartz
2    1  0     1996      0    cr quartz,beta
3    1  0     1956      0    cr     coesite
> a <- affinity(T = c(200, 1700, 200), P = c(0, 50000, 200))
affinity: variable 1 is T at 200 values from 473.15 to 1973.15 K
affinity: variable 2 is P at 200 values from 0 to 50000 bar
subcrt: 5 species at 40000 values of T (ºC) and P (bar) [energy units: J]
Error in mystate == "gas" & thermo$opt$varP : 
  operations are possible only for numeric, logical or complex types
Calls: affinity -> do.call -> energy -> sout.fun -> do.call -> subcrt
Execution halted