This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json", | |
"blocks": [ | |
{ | |
"alignment": "left", | |
"segments": [ | |
{ | |
"style": "plain", | |
"foreground": "#51829b", | |
"template": "\u2552[<#ffffff>\uF007</> {{ .UserName }}@{{ .HostName }}]", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"config": { | |
"terminology": { | |
"item": "Researcher", | |
"items": "Researchers", | |
"link": "Co-authorship link", | |
"links": "Co-authorship links", | |
"link_strength": "Co-authorships", | |
"total_link_strength": "Total co-authorships" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set the initial value of a | |
a <- 1 | |
# Print the current value of a while a is less than or equal to 5 | |
while (a <= 5){ | |
# Print the current value of a | |
print(a) | |
# Increment the value of a by 1 | |
a = a + 1 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a <- 1:3 | |
b <- 4:6 | |
# Loop over every element in a and print the result of the i-th elememt of a plus 10 | |
for (i in seq_along(a)){ | |
print(i + 10) | |
} | |
[1] 11 | |
[1] 12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a <- 2 | |
if (a > 0){ | |
print(paste0(a, " is a positive number")) | |
} else if (a < 0) { | |
print(paste0(a, " is negative number")) | |
} else { | |
print(paste0(a, " equals zero")) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The code in the braces is run when the condition is true | |
a <- 2 | |
if (a > 0) {print("positive")} | |
[1] "positive" | |
# The code in the braces is NOT run when the condition is false | |
b <- -3 | |
if (b > 0) {print("positive")} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create two vectors of equal length | |
X <- c(1, 3, 5, 8) | |
Y <- c(2, 4, 6, 7) | |
# Add the vectors together | |
X + Y | |
[1] 3 7 11 15 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The red colour channel of an image using the [0, 1] scale | |
RED <- c(1.000 0.259 0.557 0.329 1.000 0.259 0.263 0.263 1.000 0.263) | |
# Convert RED to the [0, 255] scale by multiplying by 255 | |
red <- RED * 255 | |
# Inspect the rescaled object red | |
red | |
[1] 255.000 66.045 142.035 83.895 255.000 66.045 67.065 67.065 255.000 67.065 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sp <- function (raw_values, title = "Syuzhet Plot", legend_pos = "top", | |
lps = 10, window = 0.1, plot = TRUE) | |
{ | |
wdw <- round(length(raw_values) * window) | |
rolled <- rescale(zoo::rollmean(raw_values, k = wdw, fill = 0)) | |
half <- round(wdw/2) | |
rolled[1:half] <- NA | |
end <- length(rolled) - half | |
rolled[end:length(rolled)] <- NA | |
trans <- get_dct_transform(raw_values, low_pass_size = lps, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function (raw_values, title = "Syuzhet Plot", legend_pos = "top", | |
lps = 10, window = 0.1) | |
{ | |
wdw <- round(length(raw_values) * window) | |
rolled <- rescale(zoo::rollmean(raw_values, k = wdw, fill = 0)) | |
half <- round(wdw/2) | |
rolled[1:half] <- NA | |
end <- length(rolled) - half | |
rolled[end:length(rolled)] <- NA | |
trans <- get_dct_transform(raw_values, low_pass_size = lps, |
NewerOlder