Skip to content

Commit

Permalink
random
Browse files Browse the repository at this point in the history
  • Loading branch information
miumer committed Mar 30, 2021
1 parent dd2070b commit 1460083
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions Kodutöö1/Kodutöö1.nb.html
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ <h2>Ülesanne 4</h2>
a_row
a_col</code></pre>
<!-- rnb-output-end -->
<!-- rnb-source-begin eyJkYXRhIjoiYGBgclxuYV9yb3dfY250X2FnZSA8LSBhX3JvdyAlPiVcbiAgZmlsdGVyKEFnZSAhPSAyMTEpICU+JSBcbiAgYXJyYW5nZShDb3VudHJ5LCBBZ2UpXG5cbmFfY29sX3dhcm0gPC0gYV9jb2wgJT4lIFxuICBzZWxlY3QoUXVlc3Rpb25Hcm91cE5hbWUpXG5cbm1hdDIgPC0gYXMuZGF0YS5mcmFtZShtYXQpICU+JSBcbiAgbXV0YXRlX2F0KHZhcnMoQTg6QTEwKSwgZnVucyhyZWNvZGUoLixcIjFcIj01LCBcIjJcIj00LCBcIjNcIj0zLCBcIjRcIj0yLCBcIjVcIj0xKSkpICU+JSBcbiAgbXV0YXRlX2F0KHZhcnMoQzY6QzEwKSwgZnVucyhyZWNvZGUoLixcIjFcIj01LCBcIjJcIj00LCBcIjNcIj0zLCBcIjRcIj0yLCBcIjVcIj0xKSkpICU+JSBcbiAgbXV0YXRlX2F0KHZhcnMoRzY6RzEwKSwgZnVucyhyZWNvZGUoLixcIjFcIj01LCBcIjJcIj00LCBcIjNcIj0zLCBcIjRcIj0yLCBcIjVcIj0xKSkpICU+JSBcbiAgbXV0YXRlX2F0KHZhcnMoSTE6STYpLCBmdW5zKHJlY29kZSguLFwiMVwiPTUsIFwiMlwiPTQsIFwiM1wiPTMsIFwiNFwiPTIsIFwiNVwiPTEpKSkgJT4lIFxuICBtdXRhdGVfYXQodmFycyhMMTpMNyksIGZ1bnMocmVjb2RlKC4sXCIxXCI9NSwgXCIyXCI9NCwgXCIzXCI9MywgXCI0XCI9MiwgXCI1XCI9MSkpKVxuXG5yb3cubmFtZXMoYV9jb2xfd2FybSkgPC0gYV9jb2wkUXVlc3Rpb25cbmNvbG5hbWVzKG1hdCkgPC0gYV9jb2wkUXVlc3Rpb25cblxubWF0MiA8LSBhcy5tYXRyaXgobWF0MilcblxuY29sbmFtZXMobWF0MikgPC0gYV9jb2wkUXVlc3Rpb25cblxuYW5uX2NvbHMgPSBsaXN0KEFnZSA9IGMoXCJ3aGl0ZVwiLCBcImZpcmVicmlja1wiKSxcbiAgICAgICAgICAgICAgICBDb3VudHJ5ID0gYyhBVSA9IFwiI0U0MUExQ1wiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEdCID0gXCIjMzc3RUI4XCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgSU4gPSBcIiM0REFGNEFcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBQSCA9IFwiIzk4NEVBM1wiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBLID0gXCIjRkY3RjAwXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgVVMgPSBcIiNGRkZGMzNcIiksXG4gICAgICAgICAgICAgICAgUXVlc3Rpb25Hcm91cE5hbWUgPSBjKGBFbW90aW9uYWwgU3RhYmlsaXR5YCA9IFwiIzFCOUU3N1wiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBgUnVsZS1Db25zY2lvdXNuZXNzYCA9IFwiI0U3Mjk4QVwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTZW5zaXRpdml0eSA9IFwiI0U2QUIwMlwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWaWdpbGFuY2UgPSBcIiM2NjY2NjZcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV2FybXRoID0gXCIjRDk1RjAyXCIpKVxuICAgICAgICAgICAgICAgIFxucGhlYXR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FxuICBzZWxlY3QoUXVlc3Rpb25Hcm91cE5hbWUpXG5cbm1hdDIgPC0gYXMuZGF0YS5mcmFtZShtYXQpICU+JSBcbiAgbXV0YXRlX2F0KHZhcnMoQTg6QTEwKSwgZnVucyhyZWNvZGUoLixcIjFcIj01LCBcIjJcIj00LCBcIjNcIj0zLCBcIjRcIj0yLCBcIjVcIj0xKSkpICU+JSBcbiAgbXV0YXRlX2F0KHZhcnMoQzY6QzEwKSwgZnVucyhyZWNvZGUoLixcIjFcIj01LCBcIjJcIj00LCBcIjNcIj0zLCBcIjRcIj0yLCBcIjVcIj0xKSkpICU+JSBcbiAgbXV0YXRlX2F0KHZhcnMoRzY6RzEwKSwgZnVucyhyZWNvZGUoLixcIjFcIj01LCBcIjJcIj00LCBcIjNcIj0zLCBcIjRcIj0yLCBcIjVcIj0xKSkpICU+JSBcbiAgbXV0YXRlX2F0KHZhcnMoSTE6STYpLCBmdW5zKHJlY29kZSguLFwiMVwiPTUsIFwiMlwiPTQsIFwiM1wiPTMsIFwiNFwiPTIsIFwiNVwiPTEpKSkgJT4lIFxuICBtdXRhdGVfYXQodmFycyhMMTpMNyksIGZ1bnMocmVjb2RlKC4sXCIxXCI9NSwgXCIyXCI9NCwgXCIzXCI9MywgXCI0XCI9MiwgXCI1XCI9MSkpKVxuYGBgIn0= -->
<pre class="r"><code>a_row_cnt_age &lt;- a_row %&gt;%
filter(Age != 211) %&gt;%
arrange(Country, Age)
Expand All @@ -647,9 +647,23 @@ <h2>Ülesanne 4</h2>
mutate_at(vars(C6:C10), funs(recode(.,&quot;1&quot;=5, &quot;2&quot;=4, &quot;3&quot;=3, &quot;4&quot;=2, &quot;5&quot;=1))) %&gt;%
mutate_at(vars(G6:G10), funs(recode(.,&quot;1&quot;=5, &quot;2&quot;=4, &quot;3&quot;=3, &quot;4&quot;=2, &quot;5&quot;=1))) %&gt;%
mutate_at(vars(I1:I6), funs(recode(.,&quot;1&quot;=5, &quot;2&quot;=4, &quot;3&quot;=3, &quot;4&quot;=2, &quot;5&quot;=1))) %&gt;%
mutate_at(vars(L1:L7), funs(recode(.,&quot;1&quot;=5, &quot;2&quot;=4, &quot;3&quot;=3, &quot;4&quot;=2, &quot;5&quot;=1)))
mutate_at(vars(L1:L7), funs(recode(.,&quot;1&quot;=5, &quot;2&quot;=4, &quot;3&quot;=3, &quot;4&quot;=2, &quot;5&quot;=1)))</code></pre>
<!-- rnb-source-end -->
<!-- rnb-output-begin eyJkYXRhIjoiYGZ1bnMoKWAgd2FzIGRlcHJlY2F0ZWQgaW4gZHBseXIgMC44LjAuXG5QbGVhc2UgdXNlIGEgbGlzdCBvZiBlaXRoZXIgZnVuY3Rpb25zIG9yIGxhbWJkYXM6IFxuXG4gICMgU2ltcGxlIG5hbWVkIGxpc3Q6IFxuICBsaXN0KG1lYW4gPSBtZWFuLCBtZWRpYW4gPSBtZWRpYW4pXG5cbiAgIyBBdXRvIG5hbWVkIHdpdGggYHRpYmJsZTo6bHN0KClgOiBcbiAgdGliYmxlOjpsc3QobWVhbiwgbWVkaWFuKVxuXG4gICMgVXNpbmcgbGFtYmRhc1xuICBsaXN0KH4gbWVhbiguLCB0cmltID0gLjIpLCB+IG1lZGlhbiguLCBuYS5ybSA9IFRSVUUpKVxuIn0= -->
<pre><code>`funs()` was deprecated in dplyr 0.8.0.
Please use a list of either functions or lambdas:

row.names(a_col_warm) &lt;- a_col$Question
# Simple named list:
list(mean = mean, median = median)

# Auto named with `tibble::lst()`:
tibble::lst(mean, median)

# Using lambdas
list(~ mean(., trim = .2), ~ median(., na.rm = TRUE))</code></pre>
<!-- rnb-output-end -->
<!-- rnb-source-begin eyJkYXRhIjoiYGBgclxucm93Lm5hbWVzKGFfY29sX3dhcm0pIDwtIGFfY29sJFF1ZXN0aW9uXG5jb2xuYW1lcyhtYXQpIDwtIGFfY29sJFF1ZXN0aW9uXG5cbm1hdDIgPC0gYXMubWF0cml4KG1hdDIpXG5cbmNvbG5hbWVzKG1hdDIpIDwtIGFfY29sJFF1ZXN0aW9uXG5cbmFubl9jb2xzID0gbGlzdChBZ2UgPSBjKFwid2hpdGVcIiwgXCJmaXJlYnJpY2tcIiksXG4gICAgICAgICAgICAgICAgQ291bnRyeSA9IGMoQVUgPSBcIiNFNDFBMUNcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBHQiA9IFwiIzM3N0VCOFwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIElOID0gXCIjNERBRjRBXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgUEggPSBcIiM5ODRFQTNcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBQSyA9IFwiI0ZGN0YwMFwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVTID0gXCIjRkZGRjMzXCIpLFxuICAgICAgICAgICAgICAgIFF1ZXN0aW9uR3JvdXBOYW1lID0gYyhgRW1vdGlvbmFsIFN0YWJpbGl0eWAgPSBcIiMxQjlFNzdcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYFJ1bGUtQ29uc2Npb3VzbmVzc2AgPSBcIiNFNzI5OEFcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU2Vuc2l0aXZpdHkgPSBcIiNFNkFCMDJcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVmlnaWxhbmNlID0gXCIjNjY2NjY2XCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdhcm10aCA9IFwiI0Q5NUYwMlwiKSlcbiAgICAgICAgICAgICAgICBcbnBoZWF0bWFwKHQobWF0Mltyb3duYW1lcyhhX3Jvd19jbnRfYWdlKSxdKSxcbiAgICAgICAgIG1haW4gPSBcIlBlcnNvbmFsaXR5IHRlc3QgaGVhdG1hcFwiLFxuICAgICAgICAgc2hvd19jb2xuYW1lcyA9IEYsIFxuICAgICAgICAgY2x1c3Rlcl9jb2xzID0gRixcbiAgICAgICAgIGFubm90YXRpb25fY29sID0gYV9yb3dfY250X2FnZSxcbiAgICAgICAgIGFubm90YXRpb25fcm93ID0gYV9jb2xfd2FybSxcbiAgICAgICAgIGFubm90YXRpb25fbmFtZXNfcm93ID0gRixcbiAgICAgICAgIGNsdXN0ZXJpbmdfZGlzdGFuY2VfY29sID0gXCJldWNsaWRlYW5cIiwgXG4gICAgICAgICBjbHVzdGVyaW5nX21ldGhvZCA9IFwid2FyZC5EMlwiLFxuICAgICAgICAgY2VsbGhlaWdodCA9IDgsXG4gICAgICAgICBjZWxsd2lkdGggPSAwLjcsXG4gICAgICAgICBmaWxlbmFtZSA9IFwia29kdXRvb19oZWF0Mi5wbmdcIixcbiAgICAgICAgIGhlaWdodCA9IDgsXG4gICAgICAgICB3aWR0aCA9IDEzLFxuICAgICAgICAgY3V0cmVlX3JvdyA9IDUsXG4gICAgICAgICBjb2xvciA9IGNvbG9yUmFtcFBhbGV0dGUoYyhcIiNmZmZmY2NcIiwgXCIjNDFiNmM0XCIsIFwiIzIyNWVhOFwiKSkoOTkpLFxuICAgICAgICAgYW5ub3RhdGlvbl9jb2xvcnMgPSBhbm5fY29scyxcbiAgICAgICAgIGJvcmRlcl9jb2xvciA9IGJsYWNrKVxuYGBgIn0= -->
<pre class="r"><code>row.names(a_col_warm) &lt;- a_col$Question
colnames(mat) &lt;- a_col$Question

mat2 &lt;- as.matrix(mat2)
Expand Down

0 comments on commit 1460083

Please sign in to comment.