ransomware/scratch/graphtests.R

16 lines
684 B
R

train_hist <- train_samp %>% select(-address, -label, -bw, -day, -year)
# Apply pivot_longer function to facilitate facet wrapping
train_long <- train_hist %>%
pivot_longer(colnames(train_hist)) %>%
as.data.frame()
# Log scale on value axis,
histograms <- ggplot(train_long, aes(x = value) )+
geom_histogram(aes(y = ..density..), bins=20) +
geom_density(col = "green", size = .5) +
scale_x_continuous(trans='log2') +
facet_wrap(~ name, scales = "free")
histograms + theme(axis.text.x = element_text(size = 8, angle=30, hjust=1))