## Package to control ggplot themes and colosr
install.packages('devtools')
library(devtools)
devtools::install_github("klutometis/roxygen")
library(roxygen2)
create("elisalib")
setwd("./elisalib")
document()
#
# library(ggplot2)
#
# n <- 8
# df <- data.frame(x=seq(1,n,1),
# y = seq(1,n,1),
# z = seq(1,n,1))
# ggplot(df, aes(x=x,y=y,fill=z))+
# geom_col()+
# labs(title = 'This is a title')+
# scale_fill_eeb(palette = 'Ordem',direction=1)
#
#
# basic_plot <- function(n,color_list){
# df <- data_frame(x=seq(1,n,1),
# y = seq(1,n,1),
# z = seq(1,n,1))
# p <- ggplot(df, aes(x=x,y=y,fill=z))+
# geom_col()+
# theme_minimal(base_family = 'AvantGarde') +
# theme(plot.title = element_text(size=16,face='bold'),
# plot.subtitle = element_text(size=14,face='bold'))+
# labs(title = 'This is a title')+
# scale_fill_gradientn(colours = color_list)
# #discrete_scale("fill", "brewer", brewer_pal(type, palette, direction), ...)
# #scale_fill_manual(values = my_pal(10))
# return(p)
# }
#
# get_rgb <- function(x) {
# color_table <- do.call(cbind,map(color_list,col2rgb))
# reds <- paste0('c(',paste0(color_table['red',],collapse=', '),')')
# greens <- paste0('c(',paste0(color_table['green',],collapse=', '),')')
# blues <- paste0('c(',paste0(color_table['blue',],collapse=', '),')')
# cat(reds,greens,blues,sep=',\n')
# }
#
# my_pal <- colorRampPalette(c('gold2','forestgreen','steelblue4'))
#
for(n in 3:11){
color_list <- ebvm.pal(6,'Ordem')
basic_plot(n,color_list)
print(get_rgb(color_list))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.