You are on page 1of 7

Clase 01

library(tidyverse)
library(DescTools)
library(visdat)
library(DataExplorer)
library(rio)
library(janitor)
library(skimr)
library(dataMaid)
library(summarytools)

df <- read.csv("baseuno.csv", sep=";")

df

## Sitio Cultivos_anuales Cultivo_perenne Condicion CostoAnaul


## 1 1 3.4 1.3 Buena bajo
## 2 2 2.4 2.7 Buena alto
## 3 3 2.1 3.9 Mala alto

df2=import("baseuno.csv")

df2

## Sitio Cultivos_anuales Cultivo_perenne Condicion CostoAnaul


## 1 1 3.4 1.3 Buena bajo
## 2 2 2.4 2.7 Buena alto
## 3 3 2.1 3.9 Mala alto

Z=read.table("01_Datos/zorropelon.txt", header = TRUE)

## origen sexo edad largo.total largo.cola


## 1 Vic m 8 89.0 36.0
## 2 Vic f 6 91.5 36.5
## 3 Vic f 6 95.5 39.0
## 4 Vic f 6 92.0 38.0
## 5 Vic f 2 85.5 36.0
## 6 Vic f 1 90.5 35.5
## 7 Vic m 2 89.5 36.0
## 8 Vic f 6 91.0 37.0
## 9 Vic f 9 91.5 37.0
## 10 Vic f 6 89.5 37.5
## 11 Vic f 9 89.5 39.0
## 12 Vic f 5 92.0 35.5
## 13 Vic m 5 89.5 36.0
## 14 Vic m 3 91.5 36.0
## 15 Vic m 5 85.5 34.0
## 16 Vic m 4 86.0 34.5
## 17 Vic f 1 89.5 36.5
## 18 Vic m 2 90.0 36.0
## 19 Vic f 5 90.5 35.0
## 20 Vic f 4 89.0 38.0
## 21 Vic f 3 96.5 39.5
## 22 Vic m 3 91.0 39.5
## 23 Vic f 4 89.0 36.0
## 24 Vic m 2 84.0 34.0
## 25 Vic m 3 91.5 35.5
## 26 Vic m 7 90.0 36.0
## 27 Vic f 2 85.0 35.0
## 28 Vic m 4 87.0 34.5
## 29 Vic f 3 88.0 35.0
## 30 Vic f 2 84.0 33.5
## 31 Vic m 3 93.0 37.0
## 32 Vic f 4 94.0 39.0
## 33 Vic m 3 89.0 37.0
## 34 Vic m 2 85.5 36.5
## 35 Vic m 4 85.0 35.5
## 36 Vic m 7 88.0 35.0
## 37 Vic f 2 82.5 35.0
## 38 Vic m 7 80.5 35.5
## 39 Vic f 1 75.0 34.0
## 40 Vic f 3 84.5 36.0
## 41 Vic f 5 83.0 36.5
## 42 Vic m 3 77.0 32.0
## 43 Vic f 2 81.0 32.0
## 44 Vic m NA 76.0 35.5
## 45 Vic m 3 81.0 34.0
## 46 Vic m NA 84.0 35.0
## 47 other m 2 89.0 37.5
## 48 other m 5 85.0 34.0
## 49 other m 4 85.0 37.0
## 50 other f 5 88.0 38.0
## 51 other f 5 85.0 36.0
## 52 other m 6 93.5 40.0
## 53 other f 3 91.0 38.0
## 54 other m 7 91.5 43.0
## 55 other m 2 92.5 38.0
## 56 other m 3 93.7 38.0
## 57 other f 4 93.0 41.0
## 58 other m 3 91.0 39.0
## 59 other m 2 96.0 40.0
## 60 other f 2 88.0 39.0
## 61 other m 7 86.0 38.0
## 62 other f 3 90.5 39.0
## 63 other f 6 88.5 38.0
## 64 other f 3 89.5 38.5
## 65 other f 5 88.5 38.0
## 66 other f 3 86.0 36.5
## 67 other m 4 85.0 36.5
## 68 other m 5 88.5 38.0
## 69 other m 5 88.0 37.5
## 70 other f 7 87.0 38.0
## 71 other m 6 90.0 40.0
## 72 other m 1 80.5 35.0
## 73 other m 1 82.0 36.5
## 74 other f 4 83.0 38.0
## 75 other m 6 89.0 38.0
## 76 other m 5 89.0 41.0
## 77 other m 6 84.0 36.0
## 78 other m 1 81.0 36.5
## 79 other m 1 81.0 36.5
## 80 other m 1 84.0 38.0
## 81 other m 3 85.5 38.0
## 82 other f 4 82.0 36.5
## 83 other f 3 81.5 36.0
## 84 other m 3 80.5 36.0
## 85 other m 3 92.0 40.5
## 86 other f 3 86.5 38.5
## 87 other m 2 93.0 41.5
## 88 other f 2 87.5 38.0
## 89 other m 6 84.5 35.0
## 90 other m 3 85.0 38.5
## 91 other m 3 89.0 38.0
## 92 other m 2 85.0 37.0
## 93 other m 3 82.0 38.0
## 94 other m 7 84.0 35.5
## 95 other m 4 88.5 37.5
## 96 other m 4 83.0 38.0
## 97 other m 3 86.0 38.0
## 98 other m 5 84.0 35.0
## 99 other f 3 86.5 38.5
## 100 other m 1 81.5 36.5
## 101 other m 1 82.5 39.0
## 102 other f 6 89.0 38.0
## 103 other m 4 82.5 36.5
## 104 other f 3 89.0 40.0

vis_dat(Z)
plot_missing(Z)

plot_bar(Z)
plot_boxplot(Z, by="sexo")

## Warning: Removed 2 rows containing non-finite values (stat_boxplot).


plot_density(Z)

g=ggplot(Z, aes(sexo, largo.total))


g+
geom_jitter(width = 0.2, aes( size=largo.cola, color=edad))+
facet_wrap(~origen)+
theme_classic()

You might also like