lforando / mini-project-3

Macleish Data
0 stars 0 forks source link

Challenge metrics #5

Open lzdoesdata opened 5 years ago

lzdoesdata commented 5 years ago

Now that we have plotted our desired shape files (landmarks, trails, boundary, contour), we need to devise metrics for determining what attributes make something "difficult". Here's some ideas:

  1. how quickly the elevation changes over a certain length of ft 2.length of trail 3.age friendly? etc.

let me know what you guys think!

lzdoesdata commented 5 years ago

the process for this includes:

need to create 3 variables of difficulty

(adding difficulty column to macleish layers so you can map aesthetic)

lzdoesdata commented 5 years ago

some official guidelines from nps.org: "Our trails difficulty ratings are generally based on trail condition, steepness of grades, gain and loss of elevation, and the amount and kinds of natural barriers that must be traversed. These ratings mean different things depending on if the trail was designed for foot use, for horse use, for bike use or for wheelchair use."

sarah-daum commented 5 years ago

So the code for computing length is similar to what we completed in lab 16:

library(sf) macleish_layers %>% pluck("trails") %>% st_length()

Then create a new object:

trails <- macleish_layers %>% pluck("trails") %>% mutate(computed_length = st_length(geometry))

This new data frame creates a minor problem: the names of the trails here are different than the ones on the map provided by MacLeish. Some of the trails are repeated twice, with different lengths. I don't know why this is, but I'm thinking we should estimate which trail in "trails" corresponds with the same trail on the map.

sarah-daum commented 5 years ago

Also @lzdoesdata you talked about converting meters to miles: to do that we have to get rid of the [m] that appears next to the values in the computed_length column. Here's the code for that:

trails$computed_length <- as.numeric(str_extract(trails$computed_length, "[0-9]+"))

sarah-daum commented 5 years ago

I'm unclear how we are going to actually rate the difficulty of each trail. There are several different formulas to measure it here. I think the Shenandoah system might be the most straightforward.

To summarize their method:

Equation: Elevation Gain x 2 x distance (in miles). The product's square root is the numerical rating.

Easiest Numerical Rating: less than 50

Moderate Numerical Rating: 50-100

Moderately Strenuous Numerical Rating: 100 –150

Strenuous Numerical Rating: 150-200

I doubt we will see any trails that are more than "Moderately Strenuous".

lforando commented 5 years ago

trails$computed_length <- as.numeric(str_extract(trails$computed_length, "[0-9]+")) this code is wrong dot use it !