首页 > 解决方案 > Plotting true vs predicted per country

问题描述

all. It’s me again. I’m looking to plot predicted and actual per country. This is how the test data looks

structure(list(UserLocation = structure(c(3L, 3L, 3L, 3L, 3L, 
3L, 3L, 3L, 3L, 3L), .Label = c("AT", "BE", "DE", "FR", "IT", 
"NL"), class = "factor"), FriendsLocation = structure(c(3L, 3L, 
3L, 4L, 4L, 4L, 3L, 5L, 3L, 6L), .Label = c("AT", "BE", "DE", 
"FR", "IT", "NL"), class = "factor"), scaledsci = structure(c(3L, 
3L, 3L, 1L, 2L, 1L, 3L, 2L, 3L, 2L), .Label = c("[-2.34898,-0.83219]", 
"(-0.83219,0.684599]", "(0.684599,2.20139]", "(2.20139,3.71818]"
), class = "factor"), Distancekm = structure(c(1L, 1L, 1L, 1L, 
2L, 2L, 1L, 2L, 1L, 4L), .Label = c("[47.2511,5001.27]", "(5001.27,9955.3]", 
"(9955.3,14909.3]", "(14909.3,19863.3]"), class = "factor")), row.names = c(NA, 
10L), class = "data.frame")

This is how the predicted data looks

structure(c(3L, 3L, 3L, 1L, 1L, 1L, 3L, 2L, 3L, 2L), .Label = c("[-2.34898,-0.83219]", 
"(-0.83219,0.684599]", "(0.684599,2.20139]", "(2.20139,3.71818]"
), class = "factor")

What I would like to have is to plot the predicted vs actual scaledsci per country. I do now know how to do this. Could someone please help me with this?

标签: rggplot2plotpredict

解决方案


推荐阅读