../data
directoryreadr
packageread_csv
functionread_csv("data/TEC7_REV4_26092017092200473.csv")
dplyr
data preparationselect
function from dplyr
to keep vars for plotfilter
function to reduce datasetREPORTER
: FRA
, ITA
, DEU
TOWNERSHIP
: F
SECTOR
: TOTAL
PARTNER
: TOTAL
Year
: 2011
ggplot2
REPORTER
on x-axis, Value
on y-axisFLOW
to fill
stat="identity"
Indicator
applying free y-scalesdata.frame
fill
has two values for FLOW
1
corresponds to imports, 2
to exportsleft_join
Operator/Function | Description |
---|---|
%>% |
global chaining operator (provided by the magrittr package) |
+ |
ggplot2-specific chaining operator |
read_csv() |
function for reading in .csv files (provided by the readr package) |
filter() |
reduce number of observations |
select() |
reduce number of columns |
ggplot() |
initiate plot |
geom_bar() |
add column chart |
facet_grid() |
add facetting in ggplot2 |