## Continuing example from `as_coords()`...
# \dontshow{
dm <-
c(5130.4659, 4932.7726, 4806.4339, 3853.3696, 0.0000, -3706.7044, -5306.2869, -2514.4093,
-007.6754, 1823.9137, -12246.7203, -7702.1145, 0.0000, -1217.3178, 7331.0370, -5731.1536)
names(dm) <-
rep(c("Nelson's Column", "Ostravice", "Tally Ho", "Washington Monument", "Null Island",
"Tristan da Cunha", "Mawson Peak", "Silvio Pettirossi International Airport"), 2)
invisible(as_coords(dm, fmt = 2))
latlon(dm) <- rep(c(TRUE, FALSE), each = 8)
# }
## Validate "coords" object in degrees and minutes
validate(dm)
## Deliberately change the first coordinate
## to a value greater than 60 minutes
dm[1] <- 5160.4659
validate(dm)
## Examine "valid" attribute of dm
attr(dm, "valid")
###
## Continuing second example from `as_waypoints()`...
# \dontshow{
wp <- data.frame(
lat = c(51.507765, 49.54621, 48.107232, 38.889494, 0, -37.11174, -53.104781, -25.240156),
lon = c(-0.127924, 18.398562, -122.778671, -77.035242, 0, -12.28863, 73.517283, -57.519227)
)
row.names(wp) <-
c("Nelson's Column", "Ostravice", "Tally Ho", "Washington Monument", "Null Island",
"Tristan da Cunha", "Mawson Peak", "Silvio Pettirossi International Airport")
invisible(as_waypoints(wp))
# }
## Validate "waypoints" object in decimal degrees
validate(wp)
## Deliberately change the penultimate latitude
## to an absolute value greater than 90 degrees
wp$lat[7] <- -93.104781
validate(wp)
## Examine "validlat" attribute of wp
attr(wp, "validlat")
rm(dm, wp)
Run the code above in your browser using DataLab