Commit 05435fd6 authored by Martin Isaksson's avatar Martin Isaksson
Browse files

m

parent 8677b65d
......@@ -9,7 +9,7 @@ title: Martin's blog
tagline: 'Why did you come here?'
description: 'description goes here'
url: http://martisak.github.io
baseurl: ''
baseurl: 'http://martisak.github.io/'
paginate: 5
# About/contact
......@@ -19,4 +19,4 @@ author:
email: martin@martisak.se
# Custom vars
version: 1.0.0
version: 1.0.1
......@@ -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](''figure/source/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](''figure/source/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](''figure/source/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](''figure/source/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](''figure/source/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](''figure/source/2015-08-30-washing-machine/mag5-1.png)
local({
# fall back on '/' if baseurl is not specified
baseurl = servr:::jekyll_config('.', 'baseurl', '/')
knitr::opts_knit$set(base.url = baseurl)
# fall back on 'kramdown' if markdown engine is not specified
markdown = servr:::jekyll_config('.', 'markdown', 'kramdown')
# see if we need to use the Jekyll render in knitr
if (markdown == 'kramdown') {
knitr::render_jekyll()
} else knitr::render_markdown()
# input/output filenames are passed as two additional arguments to Rscript
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),
base.url = 'http://martisak.github.io/'
)
# set where you want to host the figures (I store them in my Dropbox Public
# folder, and you might prefer putting them in GIT)
if (Sys.getenv('USER') != 'yihui') {
# these settings are only for myself, and they will not apply to you, but
# 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 = '~/Dropbox/Public/jekyll/',
base.url = 'http://db.yihui.name/jekyll/'
)
}
knitr::opts_knit$set(width = 85)
knitr::knit(a[1], a[2], quiet = TRUE, encoding = 'UTF-8', envir = .GlobalEnv)
})
\ No newline at end of file
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