knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>", 
  echo=FALSE, 
  message=FALSE, 
  warning=FALSE, 
  eval=TRUE,
  fig.align='center'
  #fig.width = 100pct
  ) 

htmltools::tagList(rmarkdown::html_dependency_font_awesome())

library(dplyr)
library(plotly) 

The sendis package was created with the aim to facilitate the import of new data. In general, if you are into criticality calculations, the first thing you will want to do is to see how other people's results compare to your calculated data. Here are the instructions to do so.

CSV template

You can import your own data provided it is in this csv template. This template is designed to be the ouput of a criticality benchmark calculation : each observation (e.g. one benchmark result per row) has 7 features or variables (in columns). This is the format that the calcs dataset follows. Below is an example of what your csv file structure should look like before it can be imported.


library(sendis)
library(kableExtra)
set.seed(137)
# sample n random entries from calcs : 
df<-calcs
n<-20
df<-df[sample(nrow(df), n), ]
rownames(df)<-NULL
df<-df%>%mutate(CODE="MYCODE",INST="MYLAB")
knitr::kable(df)%>%
  kable_styling() %>%
  scroll_box(width = "100%", height = "200px")

Format and description of variables

Note the format for the two categorical values FULLID and LIBVER is extremely important, as these columns are parsed and split at the hyphen ('-') into separate variables.

Importing into sendis

The function sendis::import_submissions() imports all *.csv files in the directory specified as its argument path. This function will fail with an error if your csv files are not in the csv template that is required.

# use function import_submission(path="yourfolder")
df<-import_submissions(path = "../docs/files/mycsvfiles/")

# verify import by checking the dimensions of dataframe `mydata`: 
dim(df)

# dataframe contains all of your csv data in `yourfolder/` :
head(df)

Your data is imported but not yet in the format of the sendis dataframe. You only need to call function compile_to_sendis() in order to do so :

# merge your dataframe and bind it to the sendis dataframe
mydata<-compile_to_sendis(df)

# verify import by checking the new dimensions of dataframe `mydata`: 
dim(mydata)
dim(sendis)

Try plotting it :

plot_afge(mydata)

Contribute your data

Submit your calculated results to be included as part of the calcs and sendis datasets of the package



fmichelsendis/sendis documentation built on June 16, 2019, 7:30 a.m.