marcusvolz / strava

Create artistic visualisations with your exercise data
Other
520 stars 57 forks source link

Can't plot elevations or heat map #20

Closed parautenbach closed 4 years ago

parautenbach commented 5 years ago

Great lib, and love using it – though I'm no R expert (I know Pandas in Python a lot better).

I've used http://liconoc.webs.upv.es/visualizando-datos-de-actividades-deportivas-con-r-y-strava/ and this repo's links and docs as code sources.

> data  <-  process_data(".")
There were 50 or more warnings (use warnings() to see the first 50)
> dim(data)
[1] 440883      9

I'm struggling to plot elevation profiles:

> p2 <- plot_map(data, lon_min = 18.760, lon_max = 19.1146, lat_min = -33.8119, lat_max = -34.021)
> p2
Error in data.frame(x = x.major, y = y.range[1]) : 
  arguments imply differing number of rows: 0, 1

Also, trying to plot the heat map:

> p3 <- plot_elevations(data)
> p3
Error in FUN(X[[i]], ...) : object 'ele' not found

The warnings above:

> warnings()
Warning messages:
1: In bind_rows_(x, .id) : Unequal factor levels: coercing to character
2: In bind_rows_(x, .id) :
  binding character and factor vector, coercing into character vector
3: In bind_rows_(x, .id) :
  binding character and factor vector, coercing into character vector
4: In bind_rows_(x, .id) :
  binding character and factor vector, coercing into character vector
5: In bind_rows_(x, .id) :
  binding character and factor vector, coercing into character vector
narfel commented 4 years ago

Better late than never, in case someone else runs into this:

"The Error in FUN(X[[i]], ...) : object 'ele' not found" is actually what happens when you try using files exported after May '18, see the Readme for that. However you can convert those newer (.FIT) files to gpx files and set the parameter old_gpx_format = TRUE in process_data().

Heat map problem: Unless you are living somewhere in the Atlantic Ocean you have your latitude and longitude swapped :)

parautenbach commented 4 years ago

Right, thanks!