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
-- After installing air, configure it like this | |
local configs = require("lspconfig.configs") | |
configs.air = { | |
default_config = { | |
cmd = { vim.fn.expand("$HOME/.local/bin/air"), "language-server" }, | |
filetypes = { "r" }, | |
root_dir = function(fname) | |
local git_dir = vim.fs.find(".git", { path = fname, upward = true })[1] | |
return git_dir and vim.fs.dirname(git_dir) or vim.loop.os_homedir() | |
end, |
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
[ins] r$> install.packages("arrow", repos = "https://cran.rstudio.com") | |
Installing package into ‘/home/filoche/R/x86_64-pc-linux-gnu-library/4.4’ | |
(as ‘lib’ is unspecified) | |
trying URL 'https://cran.rstudio.com/src/contrib/arrow_15.0.1.tar.gz' | |
Content type 'application/x-gzip' length 4373377 bytes (4.2 MB) | |
================================================== | |
downloaded 4.2 MB | |
* installing *source* package ‘arrow’ ... | |
** package ‘arrow’ successfully unpacked and MD5 sums checked |
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
library(tidyverse) | |
library(terra) | |
library(tidync) | |
raster_template <- rast( | |
xmin = -71.1, | |
xmax = -50.7, | |
ymin = 39.05, | |
ymax = 51.45, | |
resolution = 0.05, |
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
``` r | |
library(sf) | |
#> Linking to GEOS 3.12.1, GDAL 3.8.0, PROJ 9.2.0; sf_use_s2() is TRUE | |
library(duckdb) | |
#> Loading required package: DBI | |
con <- dbConnect(duckdb()) | |
dbExecute(con, "INSTALL spatial; LOAD spatial;") | |
#> [1] 0 |
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
library(dplyr) | |
library(tiledb) | |
files <- fs::dir_ls("~/Desktop/ppz/") | |
uri <- "~/Desktop/tiledb" | |
# unlink(uri, recursive = TRUE) | |
dom <- tiledb_domain(dims = c( | |
tiledb_dim("longitude", c(-180.0, 180.0), type = "FLOAT64"), |
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
sapply(fread(file, nrows = 53), class) | |
# https://git.io/JtNlE |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="generator" content="pandoc" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=EDGE" /> |
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
ctd <- ctd %>% | |
group_by(station, cast, date_time, longitude, latitude) | |
ctd | |
tic() | |
res <- ctd %>% | |
mutate(across( | |
c(flor_mg_m3, sigt_kg_m3), | |
~ zoo::rollmedian(.x, k = 11, fill = NA, align = "center"), |
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
ctd | |
tic() | |
ctd %>% | |
group_by(station, cast, date_time, longitude, latitude) %>% | |
mutate(across( | |
c(flor_mg_m3, sigt_kg_m3), | |
~ zoo::rollmedian(.x, k = 11, fill = NA, align = "center"), | |
.names = "{.col}_rollmedian" | |
)) |
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
ctd | |
tic() | |
ctd %>% | |
group_by(station, cast, date_time, longitude, latitude) %>% | |
mutate(across( | |
c(flor_mg_m3, sigt_kg_m3), | |
~ zoo::rollmedian(.x, k = 11, fill = NA, align = "center"), | |
.names = "{.col}_rollmedian" | |
)) |
NewerOlder