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
> model <- lm(Sepal.Length ~ . -Species, iris) | |
> model | |
Call: | |
lm(formula = Sepal.Length ~ . - Species, data = iris) | |
Coefficients: | |
(Intercept) Sepal.Width Petal.Length Petal.Width | |
1.8560 0.6508 0.7091 -0.5565 |
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
df <- data.frame(x=1:3,y=3:5,z=5:7) | |
# 行ごと | |
data.frame(t(apply(df, 1, function(d){ c(d, Z=sum(d)) }))) | |
data.frame(do.call(rbind, lapply(split(df, 1:nrow(df)), function(d){ c(d, Z=sum(d)) }))) | |
# 列ごと | |
data.frame(apply(df, 2, function(d){ c(d, sum(d)) })) | |
data.frame(do.call(cbind, lapply(df, function(d){ c(d, sum(d)) }))) |
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
(defn half [x] (/ x 2)) | |
(defn floor [value unit] | |
{:pre [(pos? unit)]} | |
(cond | |
(Double/isNaN value) value | |
(Double/isInfinite value) value | |
:else (let [q (quot value unit)] | |
(* unit (if (neg? (rem value unit)) | |
(dec q) q))))) |
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
[org.flatland/ordered "1.5.2"] |
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
(defn aggregate [matrix aggregate-index f group-indices] | |
(->> (group-by #(reduce (fn [m i] (conj m (nth % i))) [] group-indices) matrix) | |
(mapcat (fn [[k v]] [k (reduce f (map #(nth % aggregate-index) v))])) | |
(apply hash-map))) | |
(aggregate c 3 + [0 1]) |
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
[net.mikera/core.matrix "0.32.1"] |
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
{:exit 0, :out "Generating a project called sandbox-project based on the 'default' template.\r\nTo see other templates (app, lein plugin, etc), try `lein help new`.\r\n", :err ""} |
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
(*' *agent* *allow-unresolved-vars* *assert* *clojure-version* *command-line-args* *compile-files* *compile-path* *compiler-options* *data-readers* *default-data-reader-fn* *e *err* *file* *fn-loader* *in* *math-context* *ns* *out* *read-eval* *source-path* *unchecked-math* *use-context-classloader* *verbose-defrecords* *warn-on-reflection* +' -' ->ArrayChunk ->Vec ->VecNode ->VecSeq -cache-protocol-fn -reset-methods EMPTY-NODE accessor add-classpath agent agent-error agent-errors alias all-ns alter alter-var-root aset-boolean aset-byte aset-char aset-double aset-float aset-int aset-long aset-short await await-for await1 bases bean bigdec bigint biginteger boolean-array bound-fn bound-fn* bound? byte-array cast char-array char-escape-string char-name-string char? class class? clear-agent-errors clojure-version commute compile construct-proxy create-ns create-struct dec' decimal? default-data-readers definline definterface defmacro defstruct deliver denominator destructure dosync ensure enumeration-seq error-h |
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
<div class="row"> | |
<div class="col-md-2">住所</div> | |
<div class="col-md-4"> | |
<input id="address" class="form-control" type="text"> | |
</div> | |
<div class="col-md-2">abc</div> | |
</div> |
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
(ns sample | |
(:require [selmer.filters :as f])) | |
(f/add-filter! :cljs (fn [x] [:safe (pr-str (pr-str x))])) |