SAS उपयोगकर्ताओं के लिए R
Melinda Higgins, PhD
Research Professor/Senior Biostatistician Emory University
# [] से x का 3rd एलिमेंट चुनें
x <- c(5,3,2)
x[3]
Result
2

# रो 1, कॉलम 2 का मान चुनें
m[1, 2]
Result
4.1

# रो खाली छोड़ें, कॉलम 2 चुनें
m[, 2]
Result
4.1 2.2 5.4

# कॉलम खाली छोड़ें, रो 3 चुनें
m[3, ]
Result
2.4 5.4

# रो 2, कॉलम 3 पर एलिमेंट चुनें
d[2, 3]
FALSE
# d से दूसरा कॉलम चुनें
d[, 2]
child young old
# d से तीसरी रो चुनें
d[3, ]
2.4 old TRUE

# d से test वैरिएबल चुनें
d[,"test"]
Result
[1] TRUE FALSE TRUE

# pull() से test कॉलम लें
d %>% pull(test)
Result
TRUE FALSE TRUE

# select() से age और test लें
d %>% select(age:test)
# d से test और score निकालें
d %>% select(test, score)
age test
1 child TRUE
2 young FALSE
3 old TRUE
test score
1 TRUE 5.0
2 FALSE 3.1
3 TRUE 2.4
# slice() से रो 2 से 3 लें
d %>% slice(2:3)
Result
score age test
3.1 young FALSE
2.4 old TRUE

# d देखें
d
# d से रो 2 निकालें
d %>% slice(2)
# d से रो 3 और 1 निकालें
d %>% slice(c(3,1))
score age test
1 5.0 child TRUE
2 3.1 young FALSE
3 2.4 old TRUE
score age test
1 3.1 young FALSE
score age test
1 2.4 old TRUE
2 5.0 child TRUE
SAS उपयोगकर्ताओं के लिए R