We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
library(tidyverse) library(brolgar) #> Loading required package: tsibble #> #> Attaching package: 'tsibble' #> The following object is masked from 'package:dplyr': #> #> id library(gghighlight) wages_slope <- wages_ts %>% key_slope(ln_wages ~ xp) kmeans_data <- na.omit(wages_slope) %>% mutate(scaled = as.numeric(scale(.slope_xp))) kmeans_fit <- kmeans(kmeans_data$.intercept, centers = 5) wages_slope_kmeans <- kmeans_data %>% mutate(kmeans = kmeans_fit$cluster) %>% select(-scaled) %>% left_join(wages_ts, by = "id") ggplot(wages_slope_kmeans, aes(x = xp, y = ln_wages, group = id, colour = factor(kmeans))) + geom_line() + gghighlight() + facet_wrap(~kmeans)
Created on 2019-07-25 by the reprex package (v0.3.0)
The text was updated successfully, but these errors were encountered:
Another approach could be to use curveRep
curveRep
https://rdrr.io/cran/Hmisc/man/curveRep.html
Sorry, something went wrong.
No branches or pull requests
Created on 2019-07-25 by the reprex package (v0.3.0)
The text was updated successfully, but these errors were encountered: