Commit c1b7e2b9 authored by Martin Isaksson's avatar Martin Isaksson
Browse files

test

parent 6d616ad3
......@@ -66,14 +66,94 @@ wash %>% head
Rearrange and plot `x`,`y` and `z` components.
{% highlight r %}
wash2 <- wash %>% select(-matches("magnitude"), -threshold) %>% gather("axis", "value",-time)
ggplot(wash2, aes(x=time, y=value, color=axis)) +
geom_line() +
theme_classic() +
facet_grid(axis~.) +
scale_colour_brewer(palette = "Set1")
{% endhighlight %}
![plot of chunk mag_axis](http://martisak.github.io/2015-08-30-washing-machine/mag_axis-1.png)
Plot the magnitude
{% highlight r %}
ggplot(wash, aes(x=time, y=magnitude)) +
geom_line() +
theme_classic()
{% endhighlight %}
![plot of chunk mag1](http://martisak.github.io/2015-08-30-washing-machine/mag1-1.png)
Plot the magnitude trend
{% highlight r %}
ggplot(wash, aes(x=time, y=magnitude_ema)) +
geom_line() +
theme_classic()
{% endhighlight %}
{% highlight text %}
## Warning: Removed 19 rows containing missing values (geom_path).
{% endhighlight %}
![plot of chunk mag2](http://martisak.github.io/2015-08-30-washing-machine/mag2-1.png)
Plot the adjusted magnitude (removed magnitude trend).
{% highlight r %}
ggplot(wash, aes(x=time, y=magnitude_adj)) +
geom_line() +
theme_classic()
{% endhighlight %}
{% highlight text %}
## Warning: Removed 19 rows containing missing values (geom_path).
{% endhighlight %}
![plot of chunk mag3](http://martisak.github.io/2015-08-30-washing-machine/mag3-1.png)
Plot the normalized absolute magnitude.
{% highlight r %}
ggplot(wash, aes(x=time, y=magnitude_abs)) +
geom_line() +
theme_classic()
{% endhighlight %}
{% highlight text %}
## Warning: Removed 68 rows containing missing values (geom_path).
{% endhighlight %}
![plot of chunk mag4](http://martisak.github.io/2015-08-30-washing-machine/mag4-1.png)
Using zero as a threshold, plot on or off status.
{% highlight r %}
ggplot(wash, aes(x=time, y=threshold)) + geom_line()+ theme_classic()
{% endhighlight %}
{% highlight text %}
## Warning: Removed 68 rows containing missing values (geom_path).
{% endhighlight %}
![plot of chunk mag5](http://martisak.github.io/2015-08-30-washing-machine/mag5-1.png)
......@@ -13,8 +13,8 @@ local({
a = commandArgs(TRUE)
d = gsub('^_|[.][a-zA-Z]+$', '', a[1])
knitr::opts_chunk$set(
fig.path = sprintf('figure/%s/', d),
cache.path = sprintf('cache/%s/', d)
fig.path = sprintf('/figure/%s/', d),
cache.path = sprintf('/cache/%s/', d)
)
# set where you want to host the figures (I store them in my Dropbox Public
# folder, and you might prefer putting them in GIT)
......@@ -23,8 +23,8 @@ local({
# you may want to adapt them to your own website
knitr::opts_chunk$set(fig.path = sprintf('%s/', gsub('^.+/', '', d)))
knitr::opts_knit$set(
base.dir = '/',
base.url = 'http://martisak.github.io'
base.dir = '/Users/martisak/Documents/blog/',
base.url = 'http://martisak.github.io/'
)
}
knitr::opts_knit$set(width = 70)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment