简体   繁体   中英

How to reorder a column and include all values in that row with the reordering?

So I want to create a map showing the covid19 cases per 100.000 in Europe. However, after converting my Large SpatialPolygosDataFrame into a normal data frame with the fortify function and merging my corona information data set with the data frame of polygon data, the plot does not come out correctly anymore. I know that the cause is probably the order column, which is now not ordering the coordinates correctly anymore and has random jumps as you can see in the data frame. This is causing ggplot to incorrectly plot the coordinates in the right sequence. Does anyone know how I can reorder my entire dataframe by the column order. So the "order" column is ascending and all values around it are included in the reorder?

这是我的数据示例 每 100.000 例 COVID-19 病例

I fixed it with left_join function, this function does not reorder the rows after merging which fixed my problem. Here is a map with the left_join function: 在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM