-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpract.R
More file actions
48 lines (39 loc) · 725 Bytes
/
pract.R
File metadata and controls
48 lines (39 loc) · 725 Bytes
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
ign <- function(x)
{
if(x<0)
{
print("negative")
}
else if(x>0)
{
print("Positive")
}
else
{
print("0")
}
}
v<- c(1:12)
M1 <- matrix(v,nrow=4,ncol=3)
v1<- c(13:24)
M2 <- matrix(v1,nrow=4,ncol=3)
x<- c("1","2","3","4")
y<- c("sex","height","weight")
A <- array(data=c(M1,M2),dim = c(4,3,2),dimnames = list(x,y))
Rows <-c()
for(i in 1:4)
{
Rows <- c(Rows,paste("This is Row",i,sep=","))
}
write.table(A,file ="array.txt")
ads<- c("god",1,2,3,4)
library(tidyverse)
mpg
demo <- tribble(~a,~b,
"bar1",20,
"bar2",30,
"bar3",40)
csv <- read_csv("a,b,c
1,2,3
4,5,6
7,8,9")