knitr::opts_chunk$set(echo = TRUE) library(dplyr) library(cakeR) library(tidyr) library(stringr) library(knitr) library(tibble) library(kableExtra) d <- 7 #input your diameter h <- 4 #input your height filling <- 'buttercream' #input the type of filling fondant <- 'color' #input which type of fondant type <- 'chocolate' #input the type of cake board_color <- 'white' deco_minutes <- 120 #time to decorate the cake vol <- pi * (d/2)^2 * h surf_area <- (2 * pi * (d/2) * h) + (2 * pi * (d/2)^2) cake <- cake_round(d,h,filling,fondant,type) i <- cake[[1]] fill <- cake[[2]] fon <- cake[[3]] board <- cake_boards(cake,'round',board_color) box <- cake_boxes(board) work <- labor_cost(deco_minutes)
Cake dimensions: r d
x r h
inches
Cake type: r str_to_title(type)
Filling type: r str_to_title(filling)
Fondant type: r str_to_title(fondant)
Board: r paste(str_to_title(board$board_color),', ',board$board_type,', ',board$size_inches,' inches',sep='')
Box: r box$size
Labor: r paste(deco_minutes,'minutes')
iprice <- sum(i$price) fillprice <- sum(fill$price[-1]) fonprice <- fon[1,]$price boardprice <- round(board$price_per_unit,digits=2) boxprice <- round(box$unit_price,digits=2) lb <- round(work,digits=2) sub_total <- iprice + fillprice + fonprice + boardprice + boxprice + lb profit <- round(sub_total * .2,digits=2) total <- sub_total + profit cake_name <- paste(str_to_title(gsub('_',' ',type)),' cake',sep='') fill_name <- paste(str_to_title(gsub('_',' ',filling)),' filling',sep='') fon_name <- paste(str_to_title(fondant),' fondant',sep='') prices <- tibble(Category = c(cake_name,fill_name,fon_name,'Board','Box','Labor', 'Sub-Total','Margin','Total Price'), Price = c(iprice,fillprice,fonprice,boardprice,boxprice,lb,sub_total,profit,total)) kable(prices,'html') %>% kable_styling(full_width=T) %>% row_spec(7,bold=T,color='white',background='grey') %>% row_spec(9,bold=T,color='white',background='black')
kable(i) %>% kable_styling(full_width=T)
fill <- fill %>% arrange(price) kable(fill,'html') %>% kable_styling(full_width=T) %>% row_spec(3,bold=T,color='white',background='black')
kable(fon)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.