Skip to content

Instantly share code, notes, and snippets.

@victorkurauchi
Last active October 26, 2017 22:40
Show Gist options
  • Save victorkurauchi/a3aae10624dbd5de4af340e3634ba187 to your computer and use it in GitHub Desktop.
Save victorkurauchi/a3aae10624dbd5de4af340e3634ba187 to your computer and use it in GitHub Desktop.
3rd class working with R language
attach(Banco_1)
selecao <- Banco_1 [,c('id', 'Situacao')]
selecao
selecao <- Banco_1 [10:20, c('id', 'Situacao')]
selecao
selecao <- Banco_1 [Banco_1$sexo == 'masculino',]
selecao
selecao <- Banco_1 [Banco_1$sexo == 'masculino' & Banco_1$idade >= 30,]
selecao
uniao <- rbind(Apend_1, Apend_2)
uniao
Apend_22$Lazer <- c('')
Apend_22
library(plyr)
append <- rbind.fill(Apend_11, Apend_22)
append
chave <- merge(Apend_A, Apend_B, by=c('id'))
chave
greaterThan30 <- chave [chave$Idade >= 30,]
greaterThan30
merge(Uniao_1, uniao_2, by=c('id'), all.x = TRUE)
merge(Uniao_1, uniao_2, by=c('id'), all.y = TRUE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment