library(CDSS)
library(kstMatrix)
# library(knitr)

fpath <- system.file("extdata", "SkillAssignment.xlsx", package="CDSS")
sflist <- cdss_wf_read_skill_assignment(fpath)
sflist
b <- kstMatrix::kmbasis(sflist$sfs)
b

pl <- plot(b)
# rsvg::rsvg_png(charToRaw(DiagrammeRsvg::export_svg(pl)), paste0(tempdir(), file="/plot3.png", width=2000))
bm <- rsvg::rsvg(charToRaw(DiagrammeRsvg::export_svg(pl)), width=1500)
png::writePNG(bm, paste0(tempdir(), file="/plot3.png"))

fpath <- system.file("extdata", "SkillAssignment-T.csv", package="CDSS")
read.csv(fpath)
fpath <- system.file("extdata", "SkillAssignment-R.csv", package="CDSS")
read.csv(fpath)

fpath <- system.file("extdata", "SkillAssignment_SR.xlsx", package="CDSS")
sa <- cdss_read_skill_assignment_xlsx(fpath)
sa
cdss_sa_describes_sr(sa)

ar <- cdss_sa2ar_skill(sa)
ar
sr <- cdss_close_ar(ar)
sr

pl <- plot(sr)
# rsvg::rsvg_png(charToRaw(DiagrammeRsvg::export_svg(pl)), paste0(tempdir(), file="/plot4.png", width=1000))
bm <- rsvg::rsvg(charToRaw(DiagrammeRsvg::export_svg(pl)), width=1000)
png::writePNG(bm, paste0(tempdir(), file="/plot4.png"))

