Closed goldingn closed 9 years ago
@goldingn : it looks like the R as.location_dataframe.dataframe
also removed duplicated locations (origins); see the unit tests:
test_that("as.location_dataframe removes duplicate origins", {
testdata <- data.frame(origin=c(1,1,2,3,4), pop_origin=c(10,10,20,30,40), lat_origin=c(-1,-1,0,1,2), long_origin=c(-5,-5,-4,-3,-2))
expect_equal(nrow(as.location_dataframe(testdata)), 4)
})
Should this functionality stay in place?
Yes please, preferably with a warning telling the usr which duplicates are removed.
Task completed after merging the changes
Currently the user has to format their locations data into pairs of to-from locations, just so that
as.location_dataframe.dataframe
can flatten them back to one location per row.Instead,
as.location_dataframe.dataframe
should take a correctly formatted dataframe with location IDs, populations and x and y coordinates, and just apply the class label. The docs should be updated accordingly