# Datasets from the dataset library

# list the contents of the library
library(help = "datasets")

"https://stat.ethz.ch/R-manual/R-patched/library/datasets/html/00Index.html"

# list all available datasets in all loaded libraries
data()

# Iris flowers datasets
data(iris)
dim(iris)
levels(iris$Species)
head(iris)

write.csv(iris,"iris.csv")


# Longley's Economic Regression Data
data(longley)
dim(longley)
head(longley)

write.csv(longley,"longley.csv")


# Time series data
data(EuStockMarkets)
class(EuStockMarkets)
prova <- as.data.frame(EuStockMarkets)
time <- seq(from=1991,to=1999,length.out = 1860)
timeSeries <- cbind(time,prova)

write.csv(timeSeries,"EuStockMarkets.csv")


# Longley's Economic Regression Data
data(WorldPhones)
dim(WorldPhones)
head(WorldPhones)

write.csv(WorldPhones,"WorldPhones.csv")