It's 2020, and there's now many ways to work with data of arbitrary length in Excel:
- Power Query's M language
- JavaScript
- dynamic arrays.
But if you use or support older Excel versions, VBA can still be useful.
library(rgdal) | |
library(sp) | |
library(albersusa) # devtools::install_github("hrbrmstr/albersusa") | |
library(spdplyr) # devtools::install_github("mdsumner/spdplyr") | |
library(ggplot2) # devtools::install_github("hadley/ggplot2") | |
library(ggthemes) | |
library(rgeos) | |
library(purrr) | |
library(broom) | |
library(magick) |
function map([scriptblock]$map, [Collections.IEnumerable]$x, $y) { $x.ForEach({& $map $_ $y}) } | |
# Two parameters | |
map { param($x, $y) $x + $y } @(1,2,3) 10 | |
# Anonymous function as a value | |
$squareIt = { param($x) $x + $x } | |
map $squareIt @(1,2,3) | |
# One parameter |
#!/usr/bin/env powershell | |
# This script can keep the computer awake while executing another executable, or | |
# if no executable was passed in, then it stays awake until this script stops. | |
# There are 3 different ways of staying awake: | |
# Away Mode - Enable away mode (https://blogs.msdn.microsoft.com/david_fleischman/2005/10/21/what-does-away-mode-do-anyway/) | |
# Display Mode - Keep the display on and don't go to sleep or hibernation | |
# System Mode - Don't go to sleep or hibernation | |
# The default mode is the System Mode. | |
# Away mode is only available when away mode is enabled in the advanced power options. |
#Requires -Version 6.0 | |
<# | |
The MIT License (MIT) | |
Copyright (c) 2019 Jari Turkia (jatu@hqcodeshop.fi) | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights |