Supprimer INSA/TP anadon/.Rhistory
This commit is contained in:
parent
1de51889d9
commit
4838e3a904
1 changed files with 0 additions and 171 deletions
|
@ -1,171 +0,0 @@
|
||||||
setwd("C:/Users/PC/Desktop/INSA/anadonn")
|
|
||||||
library(knitr)
|
|
||||||
## Global options
|
|
||||||
options(max.print="75")
|
|
||||||
opts_chunk$set(echo=FALSE,
|
|
||||||
eval=FALSE,
|
|
||||||
cache=FALSE,
|
|
||||||
prompt=FALSE,
|
|
||||||
tidy=TRUE,
|
|
||||||
comment=NA,
|
|
||||||
message=FALSE,
|
|
||||||
warning=FALSE,
|
|
||||||
class.source="badCode")
|
|
||||||
opts_knit$set(width=75)
|
|
||||||
donnees <- read.table("DataProjet3MIC-2425.txt",header=TRUE, sep=";")
|
|
||||||
str(donnees)
|
|
||||||
summary(donnees)
|
|
||||||
ggplot(data = donnees)+
|
|
||||||
geom_point(aes(x=ExpT1,y=T1_1H_R1))
|
|
||||||
library(corrplot)
|
|
||||||
library(ggplot2)
|
|
||||||
library(gridExtra)
|
|
||||||
library(forcats)
|
|
||||||
library(reshape2)
|
|
||||||
library(BioStatR)
|
|
||||||
library(FactoMineR)
|
|
||||||
library(factoextra)
|
|
||||||
library(knitr)
|
|
||||||
## Global options
|
|
||||||
options(max.print="75")
|
|
||||||
opts_chunk$set(echo=FALSE,
|
|
||||||
eval=FALSE,
|
|
||||||
cache=FALSE,
|
|
||||||
prompt=FALSE,
|
|
||||||
tidy=TRUE,
|
|
||||||
comment=NA,
|
|
||||||
message=FALSE,
|
|
||||||
warning=FALSE,
|
|
||||||
class.source="badCode")
|
|
||||||
opts_knit$set(width=75)
|
|
||||||
donnees <- read.table("DataProjet3MIC-2425.txt",header=TRUE, sep=";")
|
|
||||||
head(donnees,200)
|
|
||||||
str(donnees)
|
|
||||||
summary(donnees)
|
|
||||||
ggplot(data = donnees)+
|
|
||||||
geom_point(aes(x=ExpT1,y=T1_1H_R1))
|
|
||||||
apply(donnees[,1:36],2,var)
|
|
||||||
apply(donnees[,1:36],2,mean)
|
|
||||||
hist(donnees$T1_1H_R1)
|
|
||||||
ggplot(donnees,aes(x=T1_1H_R1))+geom_boxplot()
|
|
||||||
library(knitr)
|
|
||||||
## Global options
|
|
||||||
options(max.print="75")
|
|
||||||
opts_chunk$set(echo=TRUE,
|
|
||||||
cache=FALSE,
|
|
||||||
prompt=FALSE,
|
|
||||||
tidy=TRUE,
|
|
||||||
comment=NA,
|
|
||||||
message=FALSE,
|
|
||||||
warning=FALSE,
|
|
||||||
class.source="badCode")
|
|
||||||
opts_knit$set(width=75)
|
|
||||||
library(corrplot)
|
|
||||||
library(ggplot2)
|
|
||||||
library(gridExtra)
|
|
||||||
library(forcats)
|
|
||||||
library(reshape2)
|
|
||||||
library(BioStatR)
|
|
||||||
dim(wine)
|
|
||||||
nrow(wine)
|
|
||||||
ncol(wine)
|
|
||||||
head(wine)
|
|
||||||
wine <- read.table("wine.txt",header=TRUE)
|
|
||||||
head(wine)
|
|
||||||
dim(wine)
|
|
||||||
nrow(wine)
|
|
||||||
ncol(wine)
|
|
||||||
is.data.frame(wine)
|
|
||||||
names(wine)
|
|
||||||
colnames(wine)
|
|
||||||
str(wine)
|
|
||||||
wine$Qualite<-as.factor(wine$Qualite)
|
|
||||||
wine$Type<-factor(wine$Type,labels=c("blanc","rouge"))
|
|
||||||
head(wine)
|
|
||||||
summary(wine)
|
|
||||||
gEx <- ggplot(data=wine)
|
|
||||||
summary(gEx)
|
|
||||||
names(gEx)
|
|
||||||
gEx$layers
|
|
||||||
ggplot(data=wine,aes(x=Densite,y=Alcool))+
|
|
||||||
geom_point()
|
|
||||||
ggplot(data=wine)+
|
|
||||||
geom_point(aes(x=Densite,y=Alcool,color=Type))
|
|
||||||
ggplot(data=wine)+
|
|
||||||
geom_point(aes(x=Densite,y=Alcool),color="blue")
|
|
||||||
# A COMPLETER
|
|
||||||
summary(wine$Type)
|
|
||||||
levels(wine$Type
|
|
||||||
)
|
|
||||||
table(wine$Type)
|
|
||||||
g1<-ggplot(wine, aes(x=Type))+
|
|
||||||
geom_bar()+
|
|
||||||
ylab("")+ggtitle("Effectifs")
|
|
||||||
g2<-ggplot(wine, aes(x = Type)) +
|
|
||||||
geom_bar(aes(y = (..count..)/sum(..count..)))+ylab("")+ggtitle("Frequences")
|
|
||||||
df <- data.frame(group = levels(wine$Type),
|
|
||||||
value = as.vector(table(wine$Type))/nrow(wine))
|
|
||||||
g3<-ggplot(df, aes(x="", y=value, fill=group))+
|
|
||||||
geom_bar(width = 1, stat = "identity")+
|
|
||||||
coord_polar("y", start=0)+
|
|
||||||
theme(legend.position="bottom")
|
|
||||||
grid.arrange(g3,g1,g2,ncol=3)
|
|
||||||
wine$Qualite <- fct_relevel(wine$Qualite,"bad","medium","good")
|
|
||||||
EffQual=as.vector(table(wine$Qualite))
|
|
||||||
FreqQual= data.frame(Eff = EffQual, Freq = EffQual/length(wine$Qualite), FreqCumul=cumsum(EffQual)/length(wine$Qualite))
|
|
||||||
rownames(FreqQual)=levels(wine$Qualite)
|
|
||||||
knitr::kable(FreqQual, caption = 'Description de la variable Qualite',booktabs = TRUE,digits=3)
|
|
||||||
df <- data.frame(Qualite = levels(wine$Qualite), value = table(wine$Qualite),
|
|
||||||
valuecumul = 100 * cumsum(prop.table(table(wine$Qualite))))
|
|
||||||
df$Qualite <- fct_relevel(df$Qualite, "bad", "medium", "good")
|
|
||||||
df <- data.frame(df, freq = df$value.Freq/nrow(wine))
|
|
||||||
g1 <- ggplot(wine) + geom_bar(aes(x = Qualite)) + ggtitle("Effectifs")+xlab("Qualite")
|
|
||||||
g2 <- ggplot(wine) + geom_bar(aes(x = Qualite, y = ..prop.., group = 1)) + ggtitle("Frequences")+xlab("Qualite")
|
|
||||||
g3 <- ggplot(df, aes(x = Qualite, y = valuecumul)) + geom_bar(stat = "identity") +
|
|
||||||
ggtitle("Fréquences cumulées")
|
|
||||||
g4 <- ggplot(df, aes(x = "", y = freq, fill = Qualite)) + geom_bar(width = 1, stat = "identity") +
|
|
||||||
coord_polar("y", start = 0)
|
|
||||||
grid.arrange(g1, g2, g3, g4, ncol = 2)
|
|
||||||
mean(wine$Alcool)
|
|
||||||
median(wine$Alcool)
|
|
||||||
var(wine$Alcool)
|
|
||||||
sd(wine$Alcool)
|
|
||||||
range(wine$Alcool)
|
|
||||||
summary(wine$Alcool)
|
|
||||||
quantile(wine$Alcool,0.75,names=FALSE)-quantile(wine$Alcool,0.25,names = FALSE)
|
|
||||||
quantile(wine$Alcool)
|
|
||||||
H<-hist(wine$Alcool)
|
|
||||||
ggplot(wine,aes(y=Alcool))+geom_boxplot()
|
|
||||||
wineaux<-melt(wine[,-c(1,2)])
|
|
||||||
ggplot(wineaux,aes(x=variable,y=value))+
|
|
||||||
geom_boxplot()
|
|
||||||
B<-boxplot(wine$Alcool)
|
|
||||||
print('Correlation')
|
|
||||||
cor(wine[,-c(1,2)])
|
|
||||||
print('Covariance')
|
|
||||||
cov(wine[,-c(1,2)])
|
|
||||||
help(corrplot)
|
|
||||||
corrplot(cor(wine[,-c(1,2)]),method = "ellipse")
|
|
||||||
ggplot(data=wine)+
|
|
||||||
geom_point(aes(x=Alcool,y=Densite))+
|
|
||||||
geom_smooth(aes(x=Alcool,y=Densite),method="lm")
|
|
||||||
donneesaux<-melt(donnees[,-(37:39)])
|
|
||||||
ggplot(donneesaux,aes(x=variable,y=value))+
|
|
||||||
geom_boxplot()
|
|
||||||
donneesaux<-melt(donnees[,(1:18)])
|
|
||||||
ggplot(donneesaux,aes(x=variable,y=value))+
|
|
||||||
geom_boxplot()
|
|
||||||
don_R1<-melt(donnees[,(1:18)])
|
|
||||||
gR1=ggplot(don_R1,aes(x=variable,y=value))+
|
|
||||||
geom_boxplot()
|
|
||||||
don_R2<-melt(donnees[,(19:36)])
|
|
||||||
gR2=ggplot(don_R2,aes(x=variable,y=value))+
|
|
||||||
geom_boxplot()
|
|
||||||
grid.arrange(gR1, gR2, ncol = 2)
|
|
||||||
don_R1<-melt(donnees[,(1:18)])
|
|
||||||
gR1=ggplot(don_R1,aes(x=variable,y=value))+
|
|
||||||
geom_boxplot()
|
|
||||||
don_R2<-melt(donnees[,(19:36)])
|
|
||||||
gR2=ggplot(don_R2,aes(x=variable,y=value))+
|
|
||||||
geom_boxplot()
|
|
||||||
grid.arrange(gR1, gR2, nrow = 2)
|
|
Loading…
Reference in a new issue