Job script:
#!/bin/bash
#SBATCH --job-name=rfee
#SBATCH --workdir=/home/user.name/rfee/
#SBATCH --output=r_foreach_example_console_output.txt
#SBATCH --mem-per-cpu=100 # specify RAM per CPU here in Mb
#SBATCH --time=0:02:00
Job script:
#!/bin/bash
#SBATCH --job-name=rfee
#SBATCH --workdir=/home/user.name/rfee/
#SBATCH --output=r_foreach_example_console_output.txt
#SBATCH --mem-per-cpu=100 # specify RAM per CPU here in Mb
#SBATCH --time=0:02:00
input.seq <- 1:10 | |
for(i in 1:length(input.seq)){ | |
file.con <-file(paste0('script', input.seq[i], '.R')) | |
writeLines( | |
text = c("source('my.fun.R')", | |
paste0('result', i, ' <- my.fun(x = ', i, ", y = 'character input')"), | |
paste0("save(list = 'result", i, "', file = 'result", i, ".RData')") | |
), | |
con = file.con |
library(sp) | |
library(spdep) | |
library(tidyverse) | |
library(sf) | |
data(meuse) | |
nb.boundary.radius <- 750 | |
nb.obj <- dnearneigh(x = select(meuse, x, y) %>% as.matrix(), d1 = 0, d2 = nb.boundary.radius, row.names = NULL, longlat = NULL, bounds=c("GT", "LE")) |
M-x replace-regexp <RET> | |
\(dog\)\|cat <RET> | |
\,(if \1 "cat" "dog") <RET> | |
Beginning Line 3 with `\,` tells Emacs that this line should be evaluated as a Lisp expression. | |
The `\1` on Line three referres to the first grouped of characters defined with `(` and `)` on line 2. | |
Read line 3 as if `\1` replace with "cat" else replace with "dog" | |
You have to escape (i.e. preceed with `\`) the `(`, `)` and `|` characters for them to be treated as special characters |
ray
produces one or more rays of blocks of length rng
from the fid
player's position in the direction given by their view orientation (center the cross hairs on your target). Rays of lava are particularly effective for igniting enemies. Persistent rays (pst = TRUE
) of some safe block type provide quick but messy staircases and bridges. If you accidentally ignite yourself, a ray of water starting adjacent to your position (disp
= 1) can save you if you run into it but you'll need to type fast. Non-persistant rays replace all blocks in their path first with the block type specified by rid
then with empty blocks (air type) and thus may be thought of as destroying all in their path. To ignite a pack of enemies in rapid succession set rpt
to the nu
# general demo | |
setwd('~/Documents/directory_of_csv_files/') | |
# create a collection of .csv files names following some system | |
X <- expand.grid(LETTERS,1:10) | |
for(i in 1:nrow(X)){ | |
Data.i <- data.frame(matrix(data = rnorm(1000), nrow = 10)) |
Note: These instructions work on a system running Debian (GNU + Linux) with the Gnome Desktop Environment.