Skip to content

Instantly share code, notes, and snippets.

View agricolamz's full-sized avatar

George Moroz agricolamz

View GitHub Profile
library(tidyverse)
df <- read_csv2("data.csv")
df$CASE_LBL
df |>
select(-CASE_LBL) |>
t() |>
as_tibble() ->
transposed
library(tidyverse)
library(ggiraph)
df <- read_csv("russian_journals_vectorized.csv")
df |>
mutate(for_tooltip = str_c(journal_title, "<br><br>",
author, " (",
year, ") ",
title, "<br><br>",
annotation)) |>
library(tidyverse)
library(widyr)
tribble(
~meaning, ~akhvakh, ~bolikh, ~andi, ~tindi,
"and", "wa", "wa", "wa", "ra",
"fire", "ts:a", "sa", "ts':a", NA,
"cow", "ziw", "zinu", "ziⁿw", "ziwu"
) |>
pivot_longer(names_to = "language", values_to = "value", -meaning) ->
to_merge
library(tidyverse)
readxl::read_xlsx("reflexivity_in_contact_v50.xlsx") |>
filter(residence_place != "Moita",
# remove too good Kpelle 30.08.2022
synt_position %in% c("DO", "DO Poss", "PP", "PP Poss"),
#is.na(trial),
orientation == "SELF",
!is.na(analysis)) ->
database
library(tidyverse)
library(phonfieldwork)
vowels <- c("aioueäüö")
files <- list.files(pattern = "TextGrid")
walk(files, function(file){
textgrid <- textgrid_to_df(file)
textgrid |>
library(tidyverse)
library(rvest)
# create a list of person -------------------------------------------------
s <- read_html("https://ling.hse.ru/persons")
s |>
html_nodes("a.fa-person__name") |>
html_text() |>
str_squish() ->
@agricolamz
agricolamz / r.tape
Last active November 18, 2023 02:05
Output r.gif
Set Width 1400
Set Height 1200
Hide
Type "R"
Enter
Ctrl+l
setwd("/home/agricolamz/work/bureaucracy/students/2023_Shvedova_Italy")
library(tidyverse)
df <- readxl::read_xlsx("ES_anticausative_data.xlsx")
df |>
select(-Hasp_Scale_NO, -WATP_Scale_NO) |>
rename(gloss_en = `verb pair gloss en`) |>
select(-`verb pair gloss ru`) |>
pivot_longer(names_to = "language", values_to = "value", -gloss_en) |>
mutate(value = ifelse(value %in% c("?", "-"), NA, value),
time = str_extract(language, "\\(.*?\\)"),
library(tidyverse)
# df <- readxl::read_xlsx("Для карты Кузьминой.xlsx")
#
# df |>
# pivot_longer(names_to = "latitude", values_to = "value", -longitude) |>
# filter(value != 0) |>
# write_csv("data.csv")
#
# df |>
# pivot_longer(names_to = "latitude", values_to = "value", -longitude) |>
setwd('/home/agricolamz/work/articles/2023_DiaL2/2023_Yakovleva_mari')
library(tidyverse)
library(ape)
library(phangorn)
theme_set(theme_minimal()+theme(text = element_text(size = 16), legend.position = "bottom"))
# mari --------------------------------------------------------------------
readxl::read_xlsx("/home/agricolamz/work/articles/2023_DiaL2/2023_Yakovleva_mari/сводная таблица_4 разметчика.xlsx") |>