I want the intervals to be of the form [161,168) and [182,189], instead of as they appear in the attached image, that is to say, that the intervals have parentheses and brackets.
library(grid)
library(gridExtra)
LI <- sample(155:165, 1)
a <-sample(5:10, 1)
lim <-seq ( from =LI ,by=a , length =5)
limites <- function (m ){
v <-NULL
for (i in 1: m){
v <-c(v , paste ( lim [i] ," -" , lim [i +1]) )
}
v
}
intervalos <- limites (4)
frecuencias <- sample (10:30 ,4)
tabla <-data.frame (intervalos , frecuencias)
colnames ( tabla ) <-c("Intervalos" ,"Frecuencias ")
marcasdeclase <- function (v){
vect <-NULL
n <- length (v) -1
for (k in 1: n) vect <-c( vect , mean (c(v[ k],v[k +1]) ) )
vect
}
<<echo=FALSE, results=hide, fig=TRUE,width=7.5,height=4>>=
tabla <-data.frame (intervalos , frecuencias )
colnames (tabla) <-c("Intervalos" ,"Frecuencias ")
grid.table(tabla, rows = NULL)
@