-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathExercise1.html
63 lines (62 loc) · 3.36 KB
/
Exercise1.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="generator" content="pandoc" />
<title></title>
<style type="text/css">code{white-space: pre;}</style>
<style type="text/css">
table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode {
margin: 0; padding: 0; vertical-align: baseline; border: none; }
table.sourceCode { width: 100%; line-height: 100%; }
td.lineNumbers { text-align: right; padding-right: 4px; padding-left: 4px; color: #aaaaaa; border-right: 1px solid #aaaaaa; }
td.sourceCode { padding-left: 5px; }
code > span.kw { color: #007020; font-weight: bold; }
code > span.dt { color: #902000; }
code > span.dv { color: #40a070; }
code > span.bn { color: #40a070; }
code > span.fl { color: #40a070; }
code > span.ch { color: #4070a0; }
code > span.st { color: #4070a0; }
code > span.co { color: #60a0b0; font-style: italic; }
code > span.ot { color: #007020; }
code > span.al { color: #ff0000; font-weight: bold; }
code > span.fu { color: #06287e; }
code > span.er { color: #ff0000; font-weight: bold; }
</style>
<link rel="stylesheet" href="Class.css" type="text/css" />
</head>
<body>
<h1 id="exercises">Exercises</h1>
<ul>
<li>What happens with the command <code>sum(10, 20, 30 40)</code></li>
<li>What happens when we enter the command <code>10/</code>?</li>
<li>Is <code>1 + +2</code> a legitimate command?</li>
<li>Is <code>1 + -2</code> a legitimate command?</li>
<li>Is <code>1 + *2</code> a legitimate command?</li>
<li><code>x[[1][2]</code></li>
<li><p><code>x[[1]][2</code></p></li>
<li><code>plot(x, y, main = 'Don't do this')</code> <!-- Instead, use xlab = "Don't do this" --></li>
<li><p><code>plot(x, y, xlab = "text that is "quoted" can cause problem")</code></p></li>
<li><p>How do we get and print the + function? the while function?</p></li>
<li><p>What does</p>
<pre class="sourceCode r"><code class="sourceCode r">e =<span class="st"> </span><span class="kw">parse</span>(<span class="dt">text =</span> <span class="st">"T; TRUE"</span>)</code></pre>
<p>yield? What is the difference between the two elements?</p></li>
<li><p>Use the parse() function to parse an expression</p>
<pre class="sourceCode r"><code class="sourceCode r"><span class="kw">scatter.smooth</span>(mtcars[, <span class="kw">c</span>(<span class="st">"mpg"</span>, <span class="st">"wt"</span>)], , , , <span class="st">"gaussian"</span>, <span class="st">"Weight of car"</span>, <span class="st">"Miles per Gallon"</span>,
<span class="dt">lpars =</span> <span class="kw">list</span>(<span class="dt">lwd =</span> <span class="dv">2</span>, <span class="dt">col =</span> <span class="st">"red"</span>),
<span class="dt">main =</span> <span class="st">"Motor Trends Data"</span>)</code></pre>
<p>Explore the call object you get back.</p></li>
</ul>
<!--
str = 'scatter.smooth(mtcars[, c("mpg", "wt")], , , , "gaussian", "Weight of car", "Miles per Gallon",
lpars = list(lwd = 2, col = "red"),
main = "Motor Trends Data")'
e = parse(text = str)
class(e)
length(e)
class(e[[1]])
-->
</body>
</html>