I want to plot one histogram(separate) for each variable in the column. The data is import using a CSV file(sample.csv) and looks like
ip_addr_player_id, event_name, level, points_earned, stars_earned, moves
118.93.180.241, Puzzle Complete, Botany Lab Puzzle 1, 1000, 2, 2
118.93.180.241, Puzzle Complete, Botany Lab Puzzle 2, 1000, 2, 2
118.93.180.241, Puzzle Complete, Botany Lab Puzzle 3, 1000, 2, 2
203.166.252.219, Puzzle Complete, Botany Lab Puzzle 1, 1000, 2, 2
54.166.252.324, Puzzle Complete, Botany Lab Puzzle 5, 1000, 2, 2
Given each ip_addr_player_id
is unique, I want to plot histograms (for each ip_addr_payer_id
) for points_earned
, starts_earned
and moves
.
I tried this based on an example I could find online;
library(readr)
dataIn <- read.csv("sample.csv")
#View(dataIn)
library(ggplot2)
plot <- ggplot(dataIn, aes(level, points_earned, fill=points_earned))+
geom_histogram() + facet_wrap(~ip_addr_player_id)
plot
But this code gives me no output.