I have around 20 variables which are coming from 4 different sources. I want to visualize for each variable how the data across sources varies using ggplot
.
I was thinking a line chart would be a good option to visualize. My x-axis can be each responses and 4 lines for the sources would show me how data is changing across these 4 sources of data. I can have region
as a split variable to visualize by region.
My data looks like something below (I have provided only 2 variables for simplicity):
library(data.table)
set.seed(1200)
ID <- seq(1001,1100)
region <- sample(1:10,100,replace = T)
Var1_source1 <- sample(1:100,100,replace = T)
Var1_source2 <- sample(1:100,100,replace = T)
Var1_source3 <- sample(1:100,100,replace = T)
Var1_source4 <- sample(1:100,100,replace = T)
Var2_source1 <- sample(1:100,100,replace = T)
Var2_source2 <- sample(1:100,100,replace = T)
Var2_source3 <- sample(1:100,100,replace = T)
Var2_source4 <- sample(1:100,100,replace = T)
df1 <- as.data.table(data.frame(ID,
region,
Var1_source1,
Var1_source2,
Var1_source3,
Var1_source4,
Var2_source1,
Var2_source2,
Var2_source3,
Var2_source4))
I feel this is unique requirement as I do not have anything specific to be plotted on my x axis