This file contains hidden or 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
libname sasfunc "X:\sastest" ; | |
proc fcmp outlib=sasfunc.functions.geo ; | |
function latlong2mesh(lat, long) ; | |
/* latitude */ | |
lat_in_min = lat * 60 ; | |
code12 = int(lat_in_min / 40) ; |
This file contains hidden or 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
data foo; | |
input customer_number lat long; | |
datalines; | |
1 35.039200 135.728965 | |
2 35.626065 139.884678 | |
; | |
run; | |
/* 緯度経度、shapefileの全組み合わせを取ってくる */ | |
proc sql; |
This file contains hidden or 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
libname map "path\to\lib" | |
proc mapimport out=map.japanshp datafile="path\to\N03-140401_GML\N03-14_140401.shp"; | |
run; |
This file contains hidden or 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(rvest) | |
library(stringr) | |
find_pref_city <- function(lat, lon) { | |
nominatim_url <- str_c("http://nominatim.openstreetmap.org/reverse?format=xml&lat=", | |
lat, | |
"&lon=", | |
lon, | |
"&zoom=18&addressdetails=1") | |
xmldata <- read_xml(nominatim_url) |
This file contains hidden or 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
data new; | |
set sashelp.iris; | |
rename SepalLength=new_variable; | |
run; | |
proc print data=new(obs=6); | |
run; |
This file contains hidden or 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
proc print data=sashelp.iris(obs=6); | |
run; |
This file contains hidden or 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
data gps; | |
input x y; | |
rownum = _n_; | |
datalines; | |
143.21 -33.494 | |
119.306 26.0614 | |
119.306 26.0614 | |
143.21 -33.494 | |
113.25 23.1167 | |
139.751 35.685 |
This file contains hidden or 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
(defun save-buffer (&optional arg) | |
(interactive "p") | |
(if (eq major-mode 'ein:notebook-multilang-mode) | |
(ein:notebook-save-notebook-command) | |
(let ((modp (buffer-modified-p)) | |
(make-backup-files (or (and make-backup-files (not (eq arg 0))) | |
(memq arg '(16 64))))) | |
(and modp (memq arg '(16 64)) (setq buffer-backed-up nil)) | |
(if (and modp (buffer-file-name)) | |
(message "Saving file %s..." (buffer-file-name))) |
This file contains hidden or 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
#!/bin/bash | |
counter=0 | |
for file in `\find . -maxdepth 1 -name '*.csv'`; | |
do | |
echo $file | |
if [ $counter == 0 ]; then | |
cat $file > join_result.csv | |
else |
This file contains hidden or 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
;; チャンク挿入 | |
(defun tws-insert-r-chunk (header) | |
"Insert an r-chunk in markdown mode. Necessary due to interactions between polymode and yas snippet" | |
(interactive "sHeader: ") | |
(insert (concat "```{r " header "}\n\n```")) | |
(forward-line -1)) | |
(define-key poly-markdown+r-mode-map (kbd "M-n M-r") 'tws-insert-r-chunk) | |
(defun tws-insert-py-chunk (header) |