NPlantas= round((4635)*(1/(0.5*0.3)))
NPlantas
## [1] 30900
NPlantas=47100
p=0.5
n=ceiling(NPlantas*p*(1-p)/((NPlantas-1)*(0.05/1.96)^2+p*(1-p)));n
## [1] 382
muestras<-sample(1580,24,replace = F);muestras
##  [1]  758  383  103  757 1234 1033  491 1403  458  608  821 1469 1048 1427  626
## [16]  169 1463  130 1012 1487 1428  110  329 1110
xy<-expand.grid(y=seq(1,25), x=seq(1,50));
plot(xy[muestras,], pch=15,col="green4", main = "Puntos de muestreo aleatorio de malezas lote 16");
points(xy[-muestras,], pch=22,col="royalblue2")

#presente = 1 , Ausente = 0

mode<- function(x){
  
}

mode(x)
## NULL

R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.

When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

summary(cars)
##      speed           dist       
##  Min.   : 4.0   Min.   :  2.00  
##  1st Qu.:12.0   1st Qu.: 26.00  
##  Median :15.0   Median : 36.00  
##  Mean   :15.4   Mean   : 42.98  
##  3rd Qu.:19.0   3rd Qu.: 56.00  
##  Max.   :25.0   Max.   :120.00

Including Plots

You can also embed plots, for example:

Note that the echo = FALSE parameter was added to the code chunk to prevent printing of the R code that generated the plot.