fdbk_dt_contscores: Calculates most common contingeny scores

Description Usage Arguments Value Author(s) Examples

View source: R/fdbk_asdataframe.R

Description

Calculates most common contingeny scores

Usage

1
fdbk_dt_contscores(CONTTABLE, meltTable = T)

Arguments

CONTTABLE

data.table with colums hit,miss,corrneg,false and additional columns (output of fdbk_dt_conttable(_2thrs))

meltTable

if TRUE (default) melt output so that there is one 'scores' column and one 'scorename' column

by

stratify contingency entries by these columns

Value

data.table with one column of score names and one column of scores values

Author(s)

Felix <[email protected]>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
require(ggplot2)
fnames                = system("ls ~/examplesRfdbk/*/synop/verSYNOP.*",intern=T)
cond                  = list(veri_description="grepl('forecast',veri_description)",
                             veri_forecast_time="veri_forecast_time%in%c(2400,4800,7200,9600,12000,14400,16800)")
columnnames           = c("obs","veri_data","varno","veri_model","veri_forecast_time","statid","veri_initial_date")
DT                    = fdbk_dt_multi_large(fnames,cond,columnnames,20)
thrs                  = list('29'=list('lower'=c(.8,.6),'upper'=c(Inf,.9)),
                              '3'=list('lower'=c(-5,0,5),'upper'=c(Inf,Inf,Inf)))
CONTTABLE             = fdbk_dt_conttable_2thrs(DT,thrs,by=c("veri_model","veri_forecast_time","varno"),cores=2,incores=3)
SCORES                = fdbk_dt_contscores(CONTTABLE)
ggplot(SCORES,aes(x=veri_forecast_time,y=scores,color=thr,linetype=veri_model))+
geom_line()+
geom_point()+
facet_grid(scorename~varno,scale="free_y")+
theme_bw()

rfxf/Rfdbk documentation built on Dec. 17, 2018, 9:14 a.m.