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

quartis ou outra classificação automática #20

Open
temospena opened this issue Sep 18, 2020 · 4 comments
Open

quartis ou outra classificação automática #20

temospena opened this issue Sep 18, 2020 · 4 comments

Comments

@temospena
Copy link
Owner

library(dplyr)
PONTOS60$quartis <- ntile(PONTOS60$`Cic/Hora_2019`, 4)  %>% 
                      factor(labels=c("Q1","Q2","Q3","Q4"))
table(PONTOS60$quartis)
# Q1 Q2 Q3 Q4 
# 15 15 15 15
@temospena
Copy link
Owner Author

PONTOS60$quartis2 <- cut(
  PONTOS60$`Cic/Hora_2019`,
  breaks = c(0, 15, 30, 45, 100, max(PONTOS60$`Cic/Hora_2019`)),
  labels = c("0-15","15-30","30-45","45-90", ">100")
)

@temospena
Copy link
Owner Author

num mapa, classificar automaticamente

mapview(
  Trotinetas2019PontoHoras,
  zcol = "TrotinetasHora",
  at = quantile(Trotinetas2019PontoHoras$TrotinetasHora),
  lwd = 0.5,
  layer.name = "trotinetas/hora",
  label = Trotinetas2019PontoHoras$Local,
  popup = leafpop::popupTable(
    Trotinetas2019PontoHoras,
    row.numbers = F,
    feature.id = F
  )
)

@temospena
Copy link
Owner Author

temospena commented Oct 26, 2020

PONTOS60$quartis2 <- cut(
  PONTOS60$`Cic/Hora_2019`,
  breaks = c(0, 15, 30, 45, 100, max(PONTOS60$`Cic/Hora_2019`)),
  labels = c("0-15","15-30","30-45","45-90", ">100")
)
RedeViaria$declive_class =  RedeViaria$declive %>% 
  cut(
    breaks = c(0, 3, 5, 8, 10, 20, Inf),
    labels = c("0-3: plano", "3-5: leve","5-8: médio", "8-10: exigente", "10-20: terrível", ">20: impossível"),
    right = F #para incluir o intervalo com 0-3] em vez de [
  ) 

@temospena
Copy link
Owner Author

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