ls()
rm( list = ls() )
ls()
mywd <- "L:/DataWD"
mywd
setwd( mywd )
getwd
getwd()
x <- 1:10
x
y <- matrix( 1:6, nrow = 2, ncol = 3 )
ls()
dump( c("x", "y"), file = "mydump.txt")
ls()
rm(x)
rm(y)
ls()
source( file = "mydump.txt" )
ls()
x
y
dput( y, file = "mydput.txt" )
newy <- dget( "mydput.txt" )
newy
y
newy
sink( "mysink.txt" )
x
y
sink()
x
y
dataf <- iris[c(1, 2, 51, 52, 101, 102), c(1, 2, 5)]
dataf
dataf <- edit( dataf )
dataf
write.table( dataf, "mydataf.txt" )
df <- read.table( "mydataf.txt" )
df
df$Sepal.Length
sf0 <- read.table( "mydataf0.txt" )
sf0
sf1 <- read.table( "mydataf1.txt", header = FALSE )
sf1 <- read.table( "mydataf1.txt", header = FALSE )
sf1
sf2 <- read.table( "mydataf2.txt", header = TRUE, row.names = NULL )
sf2 <- read.table( "mydataf2.txt", header = TRUE, row.names = NULL )
sf2
sf3 <- read.table( "mydataf3.txt", header = FALSE, row.names = NULL )
sf3
class(sf0)
class(sf1)
class(sf2)
class(sf3)
sf2_csv <- read.table( "mydataf2.csv", sep = ",", row.names = NULL, header = TRUE )
sf2_csv
sf2_csv2 <- read.csv( "mydataf2.csv" )
sf2_csv2
sf2_csv <- read.table( "mydataf2.csv", row.names = NULL, header = TRUE )
sf2_csv
sf2_csv <- read.table( "mydataf2.csv", sep=",", row.names = NULL, header = TRUE )
sf2_csv
read.table( "mydataf2.csv" )
read.table( "mydataf2.csv", header = TRUE )
read.table( "mydataf2.csv", header = TRUE, sep = "," )
read.table( "mydataf2.csv", header = TRUE, sep = ",", row.names = NULL )
typhoon.data <- read.table( "L:/DataWD/Typhoon-01.txt", header =  TRUE )
ttphdata <- read.table( "L:/DataWD/Typhoon-01.txt", header =  TRUE )
tphdata <- read.table( "L:/DataWD/Typhoon-01.txt", header =  TRUE )
tphdata
scandata <- scan( "scanlist.txt", list( Sepal.Length = 0, Sepal.Width = 0, Species = "") )
scandata
Insur_csv1 <- read.csv( "Insurance.csv" )
Insur_csv1
head( Insur_csv1 )
Insur_csv2 <- read.table( "Insurance.csv" )
Insur_csv2
head( Insur_csv2 )
head( Insur_csv1 )
Ins_c1 <- read.csv( "Insurance.csv" )
head( Ins_c1 )
Ins_c2 <- read.table( "Insurance.csv" )
head( Ins_c2 )
Ins_c3 <- read.table( "Insurance.csv", header = TRUE, sep="," )
head( Ins_c3 )
Ins_t1 <- read.table( "Insurance.txt" )
head( Ins_t1 )
Ins_t2 <- read.table( "Insurance.txt", header = TRUE, sep="" )
head( Ins_t2 )
data( package = "datasets" )
help( AirPassengers )
?AirPassengers
data( package = .packages( all.available = TRUE ))
data( package = "datasets" )
AirPassengers
CO2
summary( CO2 )
summary( AirPassengers)
AirPassengers
uspop
summary( uspop )
Titanic
summary( Titanic )
women
summary( women )
library(MASS)
data( Insurance )
Insurance
?Insurance
head( Insurance )
tail( Insurance )
dim( Insurance )
names( Insurance )
attributes( Insurance )
class( Insurance$District )
class( Insurance$Age )
class( Insurance$Holders )
levels( Insurance$Age )
install.packages( arules )
library( arules )
data( Groceries )
Groceries
Groceries[1:10]
inspect( Groceries[ 1:10 ] )
read.csv("http://www.quandl.com/api/v1/datasets/EUROSTAT/CRIM_PLCE_42.csv")
read.csv("http://www.quandl.com/api/v1/datasets/EUROSTAT/CRIM_PLCE_42.csv")
install.packages("XML")
library(XML)
url = "http://stockdata.stock.hexun.com/2008en/zxcwzb.aspX?stockid=000002&type=1&date=2013.06.30"
url
url
tales1 = readHTMLTable( url )
tales1
dim( tales1 )
inspect( tales1 )
tales1
tales1[1]
tales1[2]
tales1[2][1]
tales1[[2]]
tales1[[3]]
names( tales1 )
names( tales1[1] )
attributes( tales1 )
ls()
names(tales1)
tales1[[1]]
tales1[[2]]
tales1[[3]]
tales1[[4]]
aa <- tales1[[2]]
aa
class(aa)
aa[1]
aa[2]
aa[2]
aa[2,1]
aa[2,2]
aa[2,14]
aa[2,11]
install.packages("RCurl")
library(RCurl)
URL  <- "http://cc.ee.ntu.edu.tw/~fengli/Teaching/Computer/index.html"
webdata <- getURLContent( URL )
webdata
hold <- strsplit( webdata, "<LI>" )[[1]]
hold
dim( hold )
names( hold )
attributes( hold )
hold[1]
hold[2]
hold[3]
hold[4]
hold[5]
savehistory("L:/Data/Teaching/MyCourse/105-1_Programming/Code/data_161022_U06_Data From File.Rhistory")
