R Tingkat Menengah untuk Keuangan
Lore Dirick
Manager of Data Science Curriculum at Flatiron School
| Operator | Deskripsi | Representasi matematis |
|---|---|---|
| & | AND | Konjungsi (∧) |
| | | OR | Disjungsi (∨) |
| ! | NOT | Negasi (¬) |
| Operator | Deskripsi | Representasi matematis |
|---|---|---|
| & | AND | Konjungsi (∧) |
| | | OR | Disjungsi (∨) |
| ! | NOT | Negasi (¬) |
| Operator | Deskripsi | Representasi matematis |
|---|---|---|
| & | AND | Konjungsi (∧) |
| | | OR | Disjungsi (∨) |
| ! | NOT | Negasi (¬) |
| Operator | Deskripsi | Representasi matematis |
|---|---|---|
| & | AND | Konjungsi (∧) |
| | | OR | Disjungsi (∨) |
| ! | NOT | Negasi (¬) |
| Operator | Deskripsi | Representasi matematis |
|---|---|---|
| & | AND | Konjungsi (∧) |
| | | OR | Disjungsi (∨) |
| ! | NOT | Negasi (¬) |
datacamp <- 64.69
# Dan
(datacamp > 64) & (datacamp < 65)
TRUE
apple <- 124
# Atau
(datacamp > 63) | (apple > 126)
TRUE
cash <- data.frame(
company = c("A", "A", "A", "B", "B", "B", "B"),
cash_flow = c(1000, 4000, 550, 1500, 1100, 750, 6000),
year = c(1, 3, 4, 1, 2, 4, 5))
# Filter baris dengan arus kas rendah
subset(cash, cash_flow < 1000)
company cash_flow year
3 A 550 4
6 B 750 4
# Filter arus kas rendah untuk perusahaan A
subset(cash, cash_flow < 1000 & company == "A")
company cash_flow year
3 A 550 4
R Tingkat Menengah untuk Keuangan