-
Notifications
You must be signed in to change notification settings - Fork 0
/
timeseiesanalysi.R
57 lines (34 loc) · 1.37 KB
/
timeseiesanalysi.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
df<- data.frame(
emp_ID=c(1:4),
emp_name=c('hafez','jabed','jonhy','wick'),
salary=c(10000,11111,12000,10001),
dept = c("IT","Operations","HR","Finance"),
start_date=as.Date(c('2000-01-01','2012-01-01','2009-01-01','2018-01-01')),
stringsAsFactors= FALSE
)
str(df)
summary(df)
df$emp_name
df2<-data.frame(emp_ID=c(5:7),
emp_name=c("Rasmi","Pranab","Tusar"),
salary=c(578.0,722.5,632.8),
dept = c("IT","Operations","Fianance"),
start_date = as.Date(c("2013-05-21","2013-07-30","2014-06-17")),
stringsAsFactors = FALSE)
df3<-rbind(df,df2)
# timeseries
rainfall <- c(799,1174.8,865.1,1334.6,635.4,918.5,685.5,998.6,784.2,985,882.8,1071)
rainfall.timeseries<-ts(rainfall,start = c(2001,01),frequency = 12)
rainfall.timeseries
plot(rainfall.timeseries)
rainfall1 <- c(799,1174.8,865.1,1334.6,635.4,918.5,685.5,998.6,784.2,985,882.8,1071)
rainfall2 <- c(655,1306.9,1323.4,1172.2,562.2,824,822.4,1265.5,799.6,1105.6,1106.7,1337.8)
# Convert them to a matrix.
combined.rainfall <- matrix(c(rainfall1,rainfall2),nrow = 12)
combined.rainfall
ok<-ts(combined.rainfall,start=c(2016,1),frequency = 12)
plot(ok)
ok1<-ts(combined.rainfall,start=c(2016,1),frequency = 4)
ok1
setwd("E:/r")
air<-read.csv("airpassengers.csv")