Skip to content

Commit adc6a36

Browse files
authored
Add support for R (#48)
* chore: rename sample files * feat: add support for R
1 parent 87ce125 commit adc6a36

File tree

12 files changed

+76
-41
lines changed

12 files changed

+76
-41
lines changed

README.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,14 @@ different:
148148
<td><img src="https://upload.wikimedia.org/wikipedia/commons/4/48/Markdown-mark.svg" title="Markdown" alt="Markdown" width="50" /></td>
149149
<td><img src="https://upload.wikimedia.org/wikipedia/commons/c/cf/Lua-Logo.svg" title="Lua" alt="Lua" width="50" /></td>
150150
</tr>
151-
<!-- <tr> -->
152-
<!-- <td><img src="https://upload.wikimedia.org/wikipedia/commons/9/9f/Vimlogo.svg" alt="Vimscript" width="50" style="filter: grayscale(100%) blur(2px)"/></td> -->
153-
<!-- <td><img src="https://upload.wikimedia.org/wikipedia/commons/d/d5/Rust_programming_language_black_logo.svg" alt="Rust" width="50" style="filter: grayscale(100%) blur(2px)"/></td> -->
154-
<!-- <td><img src="https://upload.wikimedia.org/wikipedia/commons/c/c3/Python-logo-notext.svg" alt="Python" width="50" style="filter: grayscale(100%) blur(2px)"/></td> -->
155-
<!-- <td><img src="https://upload.wikimedia.org/wikipedia/commons/7/73/Ruby_logo.svg" alt="Ruby" width="50" style="filter: grayscale(100%) blur(2px)"/></td> -->
156-
<!-- <td></td> -->
157-
<!-- </tr> -->
151+
<tr>
152+
<td><img src="https://upload.wikimedia.org/wikipedia/commons/9/9f/Vimlogo.svg" alt="Vimscript" width="50" /></td>
153+
<td><img src="https://upload.wikimedia.org/wikipedia/commons/1/1b/R_logo.svg" alt="R" width="50" /></td>
154+
<!-- <td><img src="https://upload.wikimedia.org/wikipedia/commons/d/d5/Rust_programming_language_black_logo.svg" alt="Rust" width="50" style="filter: grayscale(100%) blur(2px)"/></td> -->
155+
<!-- <td><img src="https://upload.wikimedia.org/wikipedia/commons/c/c3/Python-logo-notext.svg" alt="Python" width="50" style="filter: grayscale(100%) blur(2px)"/></td> -->
156+
<!-- <td><img src="https://upload.wikimedia.org/wikipedia/commons/7/73/Ruby_logo.svg" alt="Ruby" width="50" style="filter: grayscale(100%) blur(2px)"/></td> -->
157+
<!-- <td></td> -->
158+
</tr>
158159
</table>
159160

160161
<!-- prettier-ignore-start -->
@@ -165,8 +166,8 @@ different:
165166
> theme! 🙂
166167
<!-- prettier-ignore-end -->
167168
168-
**Coming Soon**: Lua ✅, Vimscript (in progress), TSX, R, Rust, Python, Ruby,
169-
Bash, and many more!
169+
**Coming Soon**: Lua ✅, Vimscript ✅, R ✅, Bash, Python, TSX, Rust, Ruby, and
170+
many more!
170171

171172
## 🧩 Plugins Supported
172173

TODO.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
10. [x] `CONTRIBUTE.md`
1313
11. [x] Option to enable/disable italics
1414
12. [x] Option to enable/disable bold
15-
13. [ ] Support for R
16-
14. [ ] Update custom queries with prefix
17-
15. [ ] Issue template
18-
16. [ ] Support for Rust
19-
17. [ ] Support for Vimscript
20-
18. [ ] Support for Python
15+
13. [x] Support for Vimscript
16+
14. [x] Support for R
17+
15. [ ] Support for Python
18+
16. [ ] Update custom queries with prefix
19+
17. [ ] Issue template
20+
18. [ ] Support for Rust
2121
19. [ ] Support for Ruby
2222
20. [ ] Support for Bash

after/queries/r/highlights.scm

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
;; extends
2+
3+
(dollar
4+
(identifier) @variable.object
5+
(identifier))
6+
7+
(call
8+
function: (namespace_get
9+
namespace: (identifier)
10+
"::" @operator
11+
function: (identifier)))
12+
13+
((string
14+
"\"" @punctuation.string.delimeter))

lua/night-owl/theme.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ function theme.set_highlights(options)
114114
hl(0, "@variable.object", { fg = palette.cyan2, bg = "NONE", italic = options.italics })
115115
hl(0, "@variable.lua", { link = "Variable" })
116116
hl(0, "@variable.vim", { link = "Variable" })
117+
hl(0, "@module.r", { link = "@type.class" })
117118
hl(0, "@property", { fg = palette.cyan5, bg = "NONE" })
118119
hl(0, "tomlKey", { fg = palette.magenta, bg = "NONE", nocombine = true })
119120
hl(0, "@property.toml", { fg = palette.magenta, bg = "NONE", nocombine = true })

samples/sample.R

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
setwd("/Users/example/")
2+
data <- read.csv("budget.csv", sep = ";")
3+
4+
plot(data$sqft, data$building_scale)
5+
hist(data$sqft)
6+
hist(data$building_scale)
7+
cor.test(data$sqft, data$building_scale, na.action = "na.omit", method = c("kendall"))
8+
cor.test(data$sqft, data$building_scale, na.action = "na.omit", method = c("pearson"))
9+
10+
# 2. Lorem Ipsum
11+
12+
colnames(data)
13+
numerical_data <- data[sapply(data, is.numeric)]
14+
15+
r <- cor(data$building_scale, data$sqft)
16+
print(r^2)
17+
18+
if (!dir.exists("data")) {
19+
dir.create("data")
20+
}
21+
22+
lorem <- NA
23+
24+
credit_data <- readxl::read_xlsx("banks.xlsx")
25+
credit_data <- janitor::clean_names(banks)
26+
27+
credit_data %>%
28+
select(age, credit) %>%
29+
mutate(age_range = case_when(
30+
between(age, 18, 29) ~ "Young",
31+
between(age, 30, 45) ~ "Young Adult",
32+
between(age, 46, 50) ~ "Adult",
33+
.default = "Elderly"
34+
)) %>%
35+
filter(credit == 1) %>%
36+
select(age_rage) %>%
37+
group_by(age_range) %>%
38+
count()
39+
40+
table(credit_data$children[credit_data$credit == 1])
41+
42+
credit_data %>%
43+
select(province, monthly_income) %>%
44+
group_by(province) %>%
45+
summarise(mean_income = mean(monthly_income, na.rm = TRUE))
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)