Convert to SpatialLinesDataFrame class

as.SpatialLinesDataFrame(x)

# S3 method for epiflows
as.SpatialLinesDataFrame(x)

Arguments

x

an epiflows object

Value

an object of class [sp::SpatialLinesDataFrame]

Examples

data("Brazil_epiflows") data("YF_coordinates") ef <- add_coordinates(Brazil_epiflows, YF_coordinates[-1]) ef2 <- epicontacts::thin(ef[j = c("Espirito Santo", "Italy"), contacts = "both"]) as.SpatialLinesDataFrame(ef2)
#> An object of class "SpatialLinesDataFrame" #> Slot "data": #> from to n #> Espirito Santo:Italy Espirito Santo Italy 2827.572 #> Italy:Espirito Santo Italy Espirito Santo 1566.257 #> #> Slot "lines": #> [[1]] #> An object of class "Lines" #> Slot "Lines": #> [[1]] #> An object of class "Line" #> Slot "coords": #> lon lat #> 1 -40.30886260 -19.1834229 #> -39.81363427 -18.5675338 #> -39.32197317 -17.9503620 #> -38.83373503 -17.3319618 #> -38.34877810 -16.7123864 #> -37.86696301 -16.0916878 #> -37.38815269 -15.4699169 #> -36.91221228 -14.8471235 #> -36.43900904 -14.2233566 #> -35.96841222 -13.5986640 #> -35.50029301 -12.9730927 #> -35.03452443 -12.3466889 #> -34.57098121 -11.7194981 #> -34.10953976 -11.0915647 #> -33.65007803 -10.4629328 #> -33.19247542 -9.8336456 #> -32.73661272 -9.2037457 #> -32.28237202 -8.5732752 #> -31.82963660 -7.9422756 #> -31.37829085 -7.3107879 #> -30.92822018 -6.6788527 #> -30.47931099 -6.0465103 #> -30.03145048 -5.4138002 #> -29.58452668 -4.7807620 #> -29.13842828 -4.1474349 #> -28.69304459 -3.5138576 #> -28.24826547 -2.8800687 #> -27.80398119 -2.2461069 #> -27.36008243 -1.6120102 #> -26.91646011 -0.9778168 #> -26.47300539 -0.3435649 #> -26.02960954 0.2907076 #> -25.58616388 0.9249627 #> -25.14255969 1.5591624 #> -24.69868812 2.1932686 #> -24.25444015 2.8272431 #> -23.80970644 3.4610478 #> -23.36437734 4.0946443 #> -22.91834272 4.7279938 #> -22.47149195 5.3610575 #> -22.02371377 5.9937964 #> -21.57489626 6.6261710 #> -21.12492672 7.2581416 #> -20.67369159 7.8896681 #> -20.22107637 8.5207100 #> -19.76696556 9.1512262 #> -19.31124253 9.7811752 #> -18.85378945 10.4105151 #> -18.39448723 11.0392033 #> -17.93321540 11.6671965 #> -17.46985204 12.2944510 #> -17.00427367 12.9209220 #> -16.53635518 13.5465644 #> -16.06596973 14.1713321 #> -15.59298866 14.7951780 #> -15.11728140 15.4180543 #> -14.63871537 16.0399123 #> -14.15715588 16.6607022 #> -13.67246607 17.2803731 #> -13.18450675 17.8988733 #> -12.69313638 18.5161496 #> -12.19821090 19.1321477 #> -11.69958370 19.7468121 #> -11.19710545 20.3600859 #> -10.69062409 20.9719110 #> -10.17998464 21.5822274 #> -9.66502919 22.1909741 #> -9.14559672 22.7980881 #> -8.62152309 23.4035049 #> -8.09264086 24.0071583 #> -7.55877928 24.6089802 #> -7.01976414 25.2089006 #> -6.47541770 25.8068477 #> -5.92555861 26.4027473 #> -5.37000184 26.9965234 #> -4.80855858 27.5880976 #> -4.24103617 28.1773891 #> -3.66723807 28.7643149 #> -3.08696375 29.3487893 #> -2.50000867 29.9307242 #> -1.90616425 30.5100284 #> -1.30521779 31.0866083 #> -0.69695250 31.6603672 #> -0.08114747 32.2312053 #> 0.54242233 32.7990198 #> 1.17398600 33.3637045 #> 1.81377672 33.9251499 #> 2.46203162 34.4832430 #> 3.11899177 35.0378672 #> 3.78490200 35.5889022 #> 4.46001083 36.1362238 #> 5.14457027 36.6797038 #> 5.83883563 37.2192100 #> 6.54306529 37.7546058 #> 7.25752044 38.2857506 #> 7.98246473 38.8124989 #> 8.71816397 39.3347010 #> 9.46488567 39.8522024 #> 10.22289860 40.3648437 #> 10.99247226 40.8724608 #> 11.77387634 41.3748843 #> 1 12.56738000 41.8719400 #> #> #> #> Slot "ID": #> [1] "Espirito Santo:Italy" #> #> #> [[2]] #> An object of class "Lines" #> Slot "Lines": #> [[1]] #> An object of class "Line" #> Slot "coords": #> lon lat #> 2 12.56738000 41.8719400 #> 11.77387634 41.3748843 #> 10.99247226 40.8724608 #> 10.22289860 40.3648437 #> 9.46488567 39.8522024 #> 8.71816397 39.3347010 #> 7.98246473 38.8124989 #> 7.25752044 38.2857506 #> 6.54306529 37.7546058 #> 5.83883563 37.2192100 #> 5.14457027 36.6797038 #> 4.46001083 36.1362238 #> 3.78490200 35.5889022 #> 3.11899177 35.0378672 #> 2.46203162 34.4832430 #> 1.81377672 33.9251499 #> 1.17398600 33.3637045 #> 0.54242233 32.7990198 #> -0.08114747 32.2312053 #> -0.69695250 31.6603672 #> -1.30521779 31.0866083 #> -1.90616425 30.5100284 #> -2.50000867 29.9307242 #> -3.08696375 29.3487893 #> -3.66723807 28.7643149 #> -4.24103617 28.1773891 #> -4.80855858 27.5880976 #> -5.37000184 26.9965234 #> -5.92555861 26.4027473 #> -6.47541770 25.8068477 #> -7.01976414 25.2089006 #> -7.55877928 24.6089802 #> -8.09264086 24.0071583 #> -8.62152309 23.4035049 #> -9.14559672 22.7980881 #> -9.66502919 22.1909741 #> -10.17998464 21.5822274 #> -10.69062409 20.9719110 #> -11.19710545 20.3600859 #> -11.69958370 19.7468121 #> -12.19821090 19.1321477 #> -12.69313638 18.5161496 #> -13.18450675 17.8988733 #> -13.67246607 17.2803731 #> -14.15715588 16.6607022 #> -14.63871537 16.0399123 #> -15.11728140 15.4180543 #> -15.59298866 14.7951780 #> -16.06596973 14.1713321 #> -16.53635518 13.5465644 #> -17.00427367 12.9209220 #> -17.46985204 12.2944510 #> -17.93321540 11.6671965 #> -18.39448723 11.0392033 #> -18.85378945 10.4105151 #> -19.31124253 9.7811752 #> -19.76696556 9.1512262 #> -20.22107637 8.5207100 #> -20.67369159 7.8896681 #> -21.12492672 7.2581416 #> -21.57489626 6.6261710 #> -22.02371377 5.9937964 #> -22.47149195 5.3610575 #> -22.91834272 4.7279938 #> -23.36437734 4.0946443 #> -23.80970644 3.4610478 #> -24.25444015 2.8272431 #> -24.69868812 2.1932686 #> -25.14255969 1.5591624 #> -25.58616388 0.9249627 #> -26.02960954 0.2907076 #> -26.47300539 -0.3435649 #> -26.91646011 -0.9778168 #> -27.36008243 -1.6120102 #> -27.80398119 -2.2461069 #> -28.24826547 -2.8800687 #> -28.69304459 -3.5138576 #> -29.13842828 -4.1474349 #> -29.58452668 -4.7807620 #> -30.03145048 -5.4138002 #> -30.47931099 -6.0465103 #> -30.92822018 -6.6788527 #> -31.37829085 -7.3107879 #> -31.82963660 -7.9422756 #> -32.28237202 -8.5732752 #> -32.73661272 -9.2037457 #> -33.19247542 -9.8336456 #> -33.65007803 -10.4629328 #> -34.10953976 -11.0915647 #> -34.57098121 -11.7194981 #> -35.03452443 -12.3466889 #> -35.50029301 -12.9730927 #> -35.96841222 -13.5986640 #> -36.43900904 -14.2233566 #> -36.91221228 -14.8471235 #> -37.38815269 -15.4699169 #> -37.86696301 -16.0916878 #> -38.34877810 -16.7123864 #> -38.83373503 -17.3319618 #> -39.32197317 -17.9503620 #> -39.81363427 -18.5675338 #> 2 -40.30886260 -19.1834229 #> #> #> #> Slot "ID": #> [1] "Italy:Espirito Santo" #> #> #> #> Slot "bbox": #> min max #> x -40.30886 12.56738 #> y -19.18342 41.87194 #> #> Slot "proj4string": #> CRS arguments: +proj=longlat +ellps=WGS84 #>