Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make critical_power() and critical_speed() more flexible so it accepts data with more columns #2

Open
fmmattioni opened this issue Feb 22, 2022 · 0 comments

Comments

@fmmattioni
Copy link
Owner

Right now, if the data passed onto critical_power() and critical_speed() has more columns than the ones needed for the function, it will throw an error:

library(cyclingtools)
library(dplyr)

df <- demo_critical_power %>% 
  mutate(additional_column = 0)

df
#> # A tibble: 5 × 3
#>      PO   TTE additional_column
#>   <int> <int>             <dbl>
#> 1   446   100                 0
#> 2   385   172                 0
#> 3   324   434                 0
#> 4   290   857                 0
#> 5   280  1361                 0
  
critical_power(
  .data = df, 
  power_output_column = "PO", 
  time_to_exhaustion_column = "TTE", 
  method = c("3-hyp", "2-hyp", "linear", "1/time"), 
  plot = TRUE, 
  all_combinations = FALSE,
  reverse_y_axis = FALSE
)
#> Error: It looks like the column names you specified do not exist.

Created on 2022-02-22 by the reprex package (v2.0.1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant