TP 4: Introduction to probabilities
data(), read.table(), NROW(), order(),
write.table(), rm(), ls(), data.frame(), colnames()
data1, create a data.frame made of
CO2, but without variables $Type and $Treatment.
id, a number going from 1 to the number of rows in the data, and denoting the id of the observation/line/experiment.
uptake variable reordered in increasing order (the rest of the data.frame should also be reordered accordingly).
data2, a data.frame made of
CO2, but without variables $conc and $uptake.
id, similarly than for data1.
$id becomes $number, $Type becomes $origin and $Treatment becomes $change.
data1 in a text file data1.txt whose values are comma-separated and data2 in data2.txt with space-separated values.
data1.txt and data2.txt...
data1 and data2 using the merge function (be careful with the parameters by.x et by.y), and try to have one data.frame (it should be similar to the original CO2).
> cancer<-c("oui","oui","non","oui","non","non","oui","non")
> fumeur<-c("oui","non","non","oui","oui","non","oui","non")
> z <- data.frame(cancer,fumeur)
> table(z)
table() in order to identify the frequency at which the three variables are at values "high".
set.seed(100).