Skip to content


fortifying the data from a SpatialLinesDataFrame #751

wants to merge 2 commits into from

2 participants


I'm new to the git, i hope this is the right way to suggest small changes, I noted the data from a spatial lines data frame did not get included when fortified and thought this patch was a small easy solution

bart1 added some commits
@bart1 bart1 Update R/fortify-spatial.r d34557a
@bart1 bart1 Update R/fortify-spatial.r
Small fix so the data from a spatial lines df is also exported

Could you please rebase/merge against master, re-document with the development version of roxygen2 (install_github("klutometis/roxygen) and resubmit?

@hadley hadley closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 9, 2013
  1. @bart1

    Update R/fortify-spatial.r

    bart1 committed
  2. @bart1

    Update R/fortify-spatial.r

    bart1 committed
    Small fix so the data from a spatial lines df is also exported
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 1 deletion.
  1. +5 −1 R/fortify-spatial.r
6 R/fortify-spatial.r
@@ -79,7 +79,11 @@ fortify.Polygon <- function(model, data, ...) {
#' @export
#' @method fortify SpatialLinesDataFrame
fortify.SpatialLinesDataFrame <- function(model, data, ...) {
- ldply(model@lines, fortify)
+ df<-ldply(model@lines, fortify)
+ data<-data.frame(model)
+ data$id<-row.names(data)
+ df<-join(df,data, by='id')
+ df
#' @rdname fortify.sp
Something went wrong with that request. Please try again.