You are on page 1of 2

RRRRRRRRRRRRRRRRRR.

R
lauro

2020-08-29
library(TeachingSampling)

## Loading required package: dplyr

##
## Attaching package: 'dplyr'

## The following objects are masked from 'package:stats':


##
## filter, lag

## The following objects are masked from 'package:base':


##
## intersect, setdiff, setequal, union

## Loading required package: magrittr

data(Lucy)
attach(Lucy)
View (Lucy)
#Tamano de muestra
n<-60
muestraproy<-sample(1:nrow(Lucy),size =n, replace=FALSE)
muestraproy

## [1] 1826 838 864 771 723 661 1259 1928 1799 2015 679 1821 52 931
1878
## [16] 540 2102 1363 1720 1551 813 1663 408 260 536 2208 1574 402 1167
923
## [31] 975 1471 1157 1269 321 1503 1131 1794 1847 2355 2374 425 1168 347
1866
## [46] 738 119 1806 2152 1667 887 861 942 2350 1545 1381 435 532 138
1804

#asignar los elementos de la muestra al dataframe de datos


Lucymuestraprpoy<-Lucy[muestraproy, ]
head(Lucymuestraprpoy)

## ID Ubication Level Zone Income Employees Taxes SPAM


## 1826 AB1275 c19k44 Medium B 640 57 21.0 no
## 838 AB1990 c9k46 Small C 378 62 6.0 yes
## 864 AB202 c9k72 Small C 129 46 0.5 yes
## 771 AB1924 c8k78 Small C 410 56 7.0 yes
## 723 AB1879 c8k30 Small C 175 32 1.0 no
## 661 AB1822 c7k67 Small B 121 74 0.5 no

write.csv(Lucymuestraprpoy, file = "datoslucy.csv")

#tabla1<-table(variable fila1,variable columna)

#prop.table(tabla1)
#pie(ptop.table(tabla1))

You might also like