0
Thumbs Up |
Received: 8,702 Given: 8,964 |
Thumbs Up |
Received: 14,463 Given: 12,450 |
Thumbs Up |
Received: 8,702 Given: 8,964 |
Thumbs Up |
Received: 14,463 Given: 12,450 |
Thumbs Up |
Received: 11,836 Given: 7,303 |
Thank you!
I got this error during the process, at the final step, and clueless about the solution. Code is trying to map a fixed set of fills to the data, and therein lies the problem but don't know how to fix it.
Code:x=read.csv("x.csv",header=T,sep=";") head(x)Code:final_map <- left_join(bgr_for, id_and_cities, by = "id") head(final_map)Code:id_and_cities<- data_frame(id = rownames(bgr@data), sehir = bgr@data$NAME_1) %>% left_join(x, by = "city") head(id_and_cities)Code:ggplot(final_map) +geom_polygon( aes(x = long, y = lat, group = group, fill = x), color = "grey") + + coord_map() +theme_void() + labs(title = "*",caption = "*") + + scale_fill_distiller(name = "Score",palette = "Spectral", limits = c(15,30), na.value = "white") + + theme(plot.title = element_text(hjust = 0.5),plot.subtitle = element_text(hjust = 0.5))Aesthetics must be either length 1 or the same as the data (51254): fill
qpAdm: Bulgarian_1.DG= 77 - Kimak.SG= 23, p= 0.36, se= 0.31.
Y: Q-L330 > Q-YP771 > Q-BZ180 > Q-F16045* (F15008*) --> Baikal N, Altai MLBA, Aldy-Bel, Pazyryk, Hun.
MT: K1a --> Iron Gates, Starcevo, Bulgaria N, Bulgaria CA, Bulgaria BA.
Thumbs Up |
Received: 124 Given: 62 |
I don't know how the map file is structured but I'd give the sf package a try. (Much easier to plot spatial shapes. (a line like "ggplot(df) + geom_sf(aes(fill=x))" should do the trick)
But your fill variable name seems very generic, that might be interfering with the process if you have another variable having that name.
But 51000 entries feel a bit too much for a fill variable (which should be mapped to 51000 polygons), assuming that you're trying to plot the map of Bulgaria.
Even if the map file is not compatible you can convert it to a form that geom_sf understands using the functions from the sf package.
Thumbs Up |
Received: 939 Given: 548 |
Calculation out of 8 cities
3.96620726 Turk_Elazig
4.40184052 Turk_Igdir
4.93418686 Turk_Kars
5.33303853 Turk_Erzincan
8.66095838 Turk_Gumushane
10.16824960 Turk_Erzurum
13.69463399 Turk_Artvin
14.28223372 Turk_Ardahan
Target: Altaic
Distance: 376.7503% / 3.76750256 | ADC: 1x
76.6 Turk_Elazig
22.0 Turk_Igdir
1.4 Turk_Erzincan
Target: Altaic
Distance: 396.6207% / 3.96620726 | ADC: 2x
100.0 Turk_Elazig
Thumbs Up |
Received: 939 Given: 548 |
Calculation out of all cities in Turkey:
Distance to: Altaic
2.61363731 Turk_Malatya
3.00850461 Turk_Kilis
3.82085069 Turk_Sivas
3.96620726 Turk_Elazig
4.40184052 Turk_Igdir
4.53626498 Turk_Gaziantep
4.66673333 Turk_Corum
4.74648291 Turk_Yozgat
4.78271889 Turk_Kahranmaras
4.93418686 Turk_Kars
5.04162672 Turk_Tokat
5.17779876 Turk_Kayseri
5.22880483 Turk_Samsun
5.33303853 Turk_Erzincan
5.59743691 Turk_Kirsehir
5.77047658 Turk_Sanliurfa
5.77962802 Turk_Hatay
5.79210670 Turk_Sereflikochisar
5.91983952 Turk_Aksaray
5.95462006 Turk_Nevsehir
6.10692230 Turk_Osmaniye
6.14348435 Turk_Sinop
6.49662220 Turk_Nigde
6.49849983 Turk_Giresun_South
6.63251838 Turk_Konya
Target: Altaic
Distance: 241.7837% / 2.41783692 | ADC: 1x
76.2 Turk_Malatya
23.8 Turk_Kilis
Target: Altaic
Distance: 234.6656% / 2.34665620 | ADC: 0.5x
64.0 Turk_Malatya
34.0 Turk_Kilis
2.0 Turk_Gumushane
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks