View source: R/format_Input_Excel_output.R
format_input_Excel_output | R Documentation |
Format input data after checking and output to an Excel spreadsheet
format_input_Excel_output(XL_wb, sheet_name, outputdata, input_config)
XL_wb |
Excel workbook |
sheet_name |
Label for Excel sheet |
outputdata |
data set to be output |
input_config |
list of config values |
a <- c('','BirdsDir-A2.2')
b <- c('','')
c <- c('','')
d <- c('insect - butterfly','bird')
e <- c('Pieris rapae','Turdus merula')
f <- c('Small White','Blackbird')
g <- c('Mike Jeffries','Alnwick Wildlife Group')
h <- c('Morpeth Town','Morpeth Town')
i <- c('04/09/2010','04/09/2010')
j <- c('NZ18X','NZ18X')
k <- c('Butterfly Conservation','Alnwick Wildlife Group')
l <- c('Butterfly Conservation','Alnwick Wildlife Group')
m <- c('2 Count','1 Count')
n <- c('Considered Correct','Considered Correct')
o <- c(419000,419000)
p <- c(585000,585000)
q <- c(1000,1000)
r <- c('layer','layer')
s <- c('path','path')
t <- c(1567,890)
df <- data.frame(a,b,c,d,e,f,a,g,h,h,i,j,k,l,m,n,o,p,q,r,s,t)
names(df) <- c('All.Design', 'Wildlife..', 'Wildlife_1', 'Taxon.grou', 'Taxon.Lati', 'Taxon.Comm', 'Obs.Commen', 'Sample.Rec', 'Sample.Loc', 'Sample.L_1', 'Sample.Dat', 'Sample.Spa', 'Survey.Run', 'Survey.Nam', 'Obs.Abunda', 'Determinat', 'Central_Ea', 'Central_No', 'Buffer', 'layer', 'path','distance')
XL_wb <- openxlsx::createWorkbook()
config_keys <- c("locationCol","abundanceCol","commentCol","recorderCol","speciesCol","lastCol","dateCol","distanceCol","colCount")
locationCol <- 9
abundanceCol <- 5
commentCol <- 7
recorderCol <- 8
speciesCol <- 3
lastCol <- 14
dateCol <- 10
distanceCol <- 12
colCount <- 15
config_values <- list(locationCol,abundanceCol,commentCol,recorderCol,speciesCol,lastCol,dateCol,distanceCol,colCount)
config_pairs <- list() # Create empty list
for(i in 1:length(config_keys)) { # Add key/value pairs in for-loop
config_pairs[config_keys[i]] <- config_values[i]
}
XL_wb <- format_DR_Excel_output(XL_wb,"Data sheet",df, 1,1,config_pairs,1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.