我有一个数据集,其中包含多条对角线,我想将这些线旋转到垂直或正北,以便正确显示x轴数据。我已经看过Rodrigues公式,但是这让我望而却步,并且想知道它们是否是我可以使用的R包。请参见下面的示例,我将需要旋转它。
library(sf)
library(ggplot2)
ex<-structure(list(OBJECTID = c(10526,10913),geometry = structure(list(
structure(c(-103.47406,-103.46268,31.47367,31.48499),.Dim = c(2L,2L),class = c("XY","LInesTRING","sfg")),structure(c(-103.46525,-103.4788333,31.4879722000001,31.4748056),"sfg"))),n_empty = 0L,crs = structure(list(
epsg = 4267L,proj4string = "+proj=longlat +datum=NAD27 +no_defs"),class = "crs"),class = c("sfc_LInesTRING","sfc"),precision = 0,bbox = structure(c(xmin = -103.4788333,ymin = 31.47367,xmax = -103.46268,ymax = 31.4879722000001),class = "bbox"))),row.names = c(NA,-2L),sf_column = "geometry",agr = structure(c(OBJECTID = NA_integer_),.Label = c("constant","aggregate","identity"),class = "factor"),class = c("sf","tbl_df","tbl","data.frame"))
ggplot(ex)+geom_sf()
附上我的追求图