1 / 1

Soluzione esercizi su Vettori e Fattori

Soluzione esercizi su Vettori e Fattori. Vettori ------------------------- Es.3: > s<-rep(c("C","G","T","C"),times=3) > sub <- s[s!="C"] > sub[(length(sub)+1):(length(sub)+3)] <- NA > sub <- sub[!is.na(sub)] Es.5 > vet <- runif(100) > subvet <- vet[vet>0.2 & vet <0.6]

ulema
Download Presentation

Soluzione esercizi su Vettori e Fattori

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Soluzione esercizi su Vettori e Fattori Vettori ------------------------- Es.3: > s<-rep(c("C","G","T","C"),times=3) > sub <- s[s!="C"] > sub[(length(sub)+1):(length(sub)+3)] <- NA > sub <- sub[!is.na(sub)] Es.5 > vet <- runif(100) > subvet <- vet[vet>0.2 & vet <0.6] > w <- subvet[seq(2,length(subvet),by=2)] > w <- (w-mean(w))/sd(w) Fattori ------------------ Es.1: > f <- factor( rep( c("Level1", "Level2","Level3"), c(10,10,5))) Es.2: of <- ordered( rep( c("Basso", "Medio","Alto"), c(5,5,5)), + levels = c("Basso", "Medio","Alto")) > mis <- runif(15); mis <- sort(mis) > tapply(mis,of,mean) Basso Medio Alto 0.1517416 0.5048905 0.7578302 > tapply(mis,of,sd) Basso Medio Alto 0.02882301 0.06776671 0.12875503

More Related