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

Small mistake in one of the sample code (rolling average) #11

Open
AnttiRask opened this issue Aug 25, 2023 · 0 comments
Open

Small mistake in one of the sample code (rolling average) #11

AnttiRask opened this issue Aug 25, 2023 · 0 comments

Comments

@AnttiRask
Copy link

AnttiRask commented Aug 25, 2023

Incorrect:
midbuild <- map_df(.x = 0:50 * 10 + 1, ~ prebuild %>% mutate(score = ifelse(is.na(score), 0, score), score_smooth = zoo::rollmean(score, .x, 0), score_smooth = score_smooth / max(score_smooth), rolls = .x))

Correct:
midbuild <- map_df(.x = 0:50 * 10 + 1, ~ prebuild %>% mutate(score = ifelse(is.na(value), 0, value), score_smooth = zoo::rollmean(score, .x, 0), score_smooth = score_smooth / max(score_smooth), rolls = .x))

@AnttiRask AnttiRask changed the title Small mistake in one of the sample code Small mistake in one of the sample code (rolling average) Aug 25, 2023
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