Wednesday 20 December 2017

Learning more about git: Reverting a commit...

Within github,
     I want to try reverting to a version of drawProteins that passed build...

So the reversion seems to have worked.

Bumped to 0.99.5 to try to get a new build... don't know if it will be enough...

Currently being tested on Bioconductor and Travis... time for a cup of tea.
currently 13:54


So now I have created a branch in Github Desktop

However, how do I know I'm working on a branch?



So within Git Desktop there is the option to commit to 'master' or 'branch'

Great.
And there was a publish button at one point.
FROM NOW ON: only commit to devel until it works and builds - need separate build process, I think....

Travis will build automatically which is good.

Monday 18 December 2017

Trying to open Raspberry Pi SD card on a mac...

Tried: 
https://www.engadget.com/2009/09/07/how-to-set-up-ubuntu-linux-on-a-mac-its-easy-and-free/

creating a Virtual Box
Downloaded ISO file from here:
https://www.raspberrypi.org/downloads/raspberry-pi-desktop/

This worked and gave me a nice raspberry pi version on the mac - very useful. 

But still can't access the SD file...

This advice would be good but I can't really understand it...
https://www.engadget.com/2009/09/07/how-to-set-up-ubuntu-linux-on-a-mac-its-easy-and-free/




Sunday 17 December 2017

Setting up a python script to run on Pi Zero on start up....

Between these two links:

https://www.raspberrypi.org/forums/viewtopic.php?p=921354#p921354

https://www.raspberrypi-spy.co.uk/2015/10/how-to-autorun-a-python-script-on-boot-using-systemd/

I managed to hack together a service file that uses `systemd` 

- make a service script and then run on startup....


https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units



maybe:
https://unix.stackexchange.com/questions/47695/how-to-write-startup-script-for-systemd

It seems that I might be able to start with Control C to prevent it running scripts. 
Check tonight....


More about services here:


https://gist.github.com/drmalex07/d006f12914b21198ee43


http://www.sharats.me/posts/the-ever-useful-and-neat-subprocess-module/
This is interesting...




Saturday 2 December 2017

Python...

So it seems I need to learn a bit about python for home reasons.

Installing packages on the mac - use homebrew
https://penandpants.com/2012/02/24/install-python/

linux cheat sheet
https://www.cheatography.com/davechild/cheat-sheets/linux-command-line/#downloads

apt-get commands
https://www.tecmint.com/useful-basic-commands-of-apt-get-and-apt-cache-for-package-management/


Wednesday 29 November 2017

Resources to open Word documents in R...


Extracting data from a docx file:
https://cran.r-project.org/web/packages/docxtractr/docxtractr.pdf

https://www.r-bloggers.com/new-pacakge-docxtractr-easily-extract-tables-from-microsoft-word-docs/

https://rud.is/b/2015/08/24/new-pacakge-docxtractr-easily-extract-tables-from-microsoft-word-docs/



Extracting data from a doc file:
https://cran.r-project.org/web/packages/textreadr/textreadr.pdf

Splitting a character vector into a data frame...
https://stackoverflow.com/questions/22455884/how-to-split-a-character-vector-into-data-frame

Rowbind when different numbers of columns...
https://stackoverflow.com/questions/3402371/combine-two-data-frames-by-rows-rbind-when-they-have-different-sets-of-columns

Thursday 9 November 2017

Some information regarding the ~ symbol...

Some information regarding the ~ symbol...

Some points:
  1. The symbol ~ is called tilde so searching with the word is useful. 
  2. It's use in v~Vmax*S/(Km+S) is to create the non-linear formula. 
  3. It's special R syntax rather than general bioinformatics syntax. 
  4. It's specific meaning in this context is to create a formula object in R which can be used later. 
  5. The ~ symbol (tilde) separates one side of the formula from the other.
  6. The symbol means that R doesn't try to evaluate the formula but creates an object - sometimes a "formula" object

By way of an example, here is some R code:
my_formula <- y ~ bot+(top-bot)/(1+( x / LD50)^slope)
class(my_formula)

The tilda means that the equation won't be run but just the object created. 
The object in this case is my_formula and the class of the object is "formula". The tilda sets y on the left hand side and x, bot, top, LD50 and slope on the right hand side. 

That's enough for a start but questions are welcome. 

Some resources:
END of info for now...

Tuesday 31 October 2017

Working through Travis...

One good thing - as soon as a Github commit is synced online - Travis will check the build.

Latest build #11 has been running for over 10 minutes without an error.
Preparing the Vignettes takes a while - maybe worth simplifying....



Good news is that 2 warnings and 2 notes is what I get with my local build check. 

Undocumented code objects:
‘draw_mol_horiz’ ‘draw_phosphosites’ ‘extract_names’
‘extractFeaturesList’ ‘extractFeaturesListwithAcc’ ‘five_rel_list’
‘geom_motif’ ‘geom_region’ ‘geom_repeat’ ‘prot_data’ ‘protein_json’
rel_A_features’
Undocumented data sets:
‘five_rel_list’ ‘prot_data’ ‘protein_json’ ‘rel_A_features’

AND

* checking Rd \usage sections ... WARNING
Undocumented arguments in documentation object 'geom_chains'
‘label_chains’
Documented arguments not in \usage in documentation object 'geom_chains':
‘label_chain’
Functions with \usage entries need to have the appropriate \alias
entries, and all their arguments documented.
The \usage entries must correspond to syntactically valid R code.
See chapter ‘Writing R documentation files’ in the ‘Writing R
Extensions’ manual.



I checked the .travis.yml on ggtree (https://github.com/GuangchuangYu/ggtree).

ggtree Travis info would seem to be in the public domain:
https://ci.appveyor.com/project/GuangchuangYu/ggtree/branch/master

Lots of good info on Travis website:
https://docs.travis-ci.com/user/notifications/

Also these link:
https://docs.travis-ci.com/user/languages/r/
http://jtleek.com/protocols/travis_bioc_devel/
https://github.com/craigcitro/r-travis/wiki


Travis examples:
https://github.com/csgillespie/travis-examples/blob/master/bioconductor/.travis.yml



Need to get Coverage done as well:
Maybe: https://codecov.io/
OR:

Troubleshooting in Travis

Problem:

* creating vignettes ... ERROR
Error: processing vignette 'drawProteins_BiocStyle_pdf_output.Rmd' failed with diagnostics:
there is no package called ‘BiocStyle’
Execution halted


Some advice here:
http://jtleek.com/protocols/travis_bioc_devel/

https://github.com/craigcitro/r-travis/wiki



This is interesting too:
http://lint.travis-ci.org/


Thursday 19 October 2017

Some colour links....

R Colour Cheat Sheet
https://www.nceas.ucsb.edu/~frazier/RSpatialGuides/colorPaletteCheatsheet.pdf

R blogger piece about colour
https://www.r-bloggers.com/r-using-rcolorbrewer-to-colour-your-figures-in-r/


Wednesday 6 September 2017

Some links to remember including some Arduino stuff....

Geomapping London
http://spatialanalysis.co.uk/wp-content/uploads/2013/04/james_cheshire_ggplot_intro_blog.pdf

Graph Theory
https://dev.to/vaidehijoshi/a-gentle-introduction-to-graph-theory


Arduino
https://create.arduino.cc/projecthub/Arduino_Genuino/getting-started-with-the-arduino-web-editor-4b3e4a
https://www.arduino.cc/en/Reference/HomePage

https://github.com/punkplod23/CodeClubArduino

Making robots
http://www.instructables.com/id/How-To-Make-an-Obstacle-Avoiding-Arduino-Robot/
http://makezine.com/projects/building-a-simple-arduino-robot/




https://www.bps.ac.uk/news-events/future-scientific-meetings

http://www.mathematicshed.com/the-gender-neutral-shed.html




Friday 18 August 2017

Reading Hadley's Package chapter about Documentation

Key point:

Use Roxygen comments in the R files - then the documentation takes care of itself!


Cut and pasted from: http://r-pkgs.had.co.nz/man.html

The documentation workflow

In this section, we’ll first go over a rough outline of the complete documentation workflow. Then, we’ll dive into each step individually. There are four basic steps:
  1. Add roxygen comments to your .R files.
  2. Run devtools::document() (or press Ctrl/Cmd + Shift + D in RStudio) to convert roxygen comments to .Rd files. (devtools::document() calls roxygen2::roxygenise() to do the hard work.)
  3. Preview documentation with ?.
  4. Rinse and repeat until the documentation looks the way you want.


Roxygen comments start with #'

For functions:

As well as the introduction block, most functions have three tags: @param@examples and @return.


Introduction is the first part!

Each block includes some text before the first tag.1 This is called the introduction, and is parsed specially:
  • The first sentence becomes the title of the documentation. That’s what you see when you look at help(package = mypackage) and is shown at the top of each help file. It should fit on one line, be written in sentence case, and end in a full stop.
  • The second paragraph is the description: this comes first in the documentation and should briefly describe what the function does.
  • The third and subsequent paragraphs go into the details: this is a (often long) section that is shown after the argument description and should go into detail about how the function works.
All objects must have a title and description. Details are optional.


Well happy days (or evenings), I just completed my first documentation of a function!

Hi res images for blog...

https://xomisse.com/blog/how-to-fix-blurry-images-on-blogger/

and

https://danieljhocking.wordpress.com/2013/03/12/high-resolution-figures-in-r/

Wednesday 16 August 2017

aim - get drawProteins on Bioconductor

need unit testing
need vignette

found this style on github

https://github.com/juliangehring/vignettes



This is also very important:

https://bioconductor.org/packages/devel/bioc/vignettes/BiocStyle/inst/doc/AuthoringRmdVignettes.html

https://bioconductor.org/packages/devel/bioc/vignettes/BiocStyle/inst/doc/HtmlStyle.html


Unit Test Guidelines:
https://www.bioconductor.org/developers/how-to/unitTesting-guidelines/

Information on making Bioconductor contributions through Github
https://github.com/Bioconductor/Contributions


This link is important too:
https://cran.r-project.org/web/packages/ggplot2/vignettes/extending-ggplot2.html

Tuesday 15 August 2017

Trying to improve resolution of pictures on Blogger...

Key step 1:

Use Original size!

Some advice here:
https://xomisse.com/blog/how-to-fix-blurry-images-on-blogger/

It's a bit frustrating and I really need to find a robust way to do this!!!!

explot_1 
PNG file
Direct export from RStudio - 600 x 300 pixels
Text size = 10
Shown below as original size.


Not too back actually in terms of the text and the line.
Probably not publication standard :-(


explot_2 
PNG file
Direct export from RStudio - 900 x 300 pixels
Text size = 10
Shown below as original size.
Text fills less of the bars.


explot_3 
PNG file
p + ggsave("explot_3.png",
           width = 4, height = 2, units = "in",
           dpi = 600)
Text size = 10
Shown below as original size.

Shown here as x-large

So text fills a lot more of the image as the text size is fixed - 10mm, I guess.


explot_4.png
p + ggsave("explot_4.png",
           width = 2, height = 1, units = "in",
           dpi = 600)

Original size:


Shown here as x-large



However, when I just export my five columns, I get dreadful pixillation of my text...


lines pixillated too. 

Try this:
p + ggsave("five_rect.png",
           width = 10, height = 5, units = "cm",
           dpi = 600)




Adding some text with size = 2 - should be 2mm, I think. 

p + ggsave("five_rect_with_text.png",
           width = 10, height = 5, units = "cm",
           dpi = 600)

Lots of work on adjusting sizes etc... all a bit painful and frustrating but...




BACK TO USING DEFAULTS




Thursday 10 August 2017

Learning about unit testing...

Good info from Steph yesterday at our R-User Group.

1.   Create an R script in the test folder.
Q: do they have to start with "test-"?

2.   Add a context using the context() function.
Gives information about what's been tested and why in broad terms.

3.   Key function is test_that()
The test_that() function has two arguments:
A. description - test name.
B. test code made up of expectation - in curly brackets


Code for my first simplest tests:

test_that("extract_names gives a list",{

  # load data from the package - should I move it into the test folder
  data("protein_json")
  # creates object protein_json in the environment.
  # it's the json data for Q04206 - for the transcription factor RelA

  # Nice simple test
  res <- extract_names(protein_json)
  expect_is(res, "list")
  expect_equal(length(res),6)

})

To run the tests 

- operate within the Rproj for your package.

Use the function: test()


When it doesn't work, output looks like this:


> test()
Loading drawProteins
Testing drawProteins
extract_names: 1

Failed ----------------------------------------------------------------------
1. Error: extract_names gives a list (@test-extract_names.R#12) -------------
object 'sample_protein_json' not found
1: extract_names(sample_protein_json) at /Users/paulbrennan/Documents/drawProteins/tests/testthat/test-extract_names.R:12

DONE ========================================================================

When it works it looks like this:

> test()
Loading drawProteins
Testing drawProteins
extract_names: ..

DONE ========================================================================


That's enough for now...

Friday 30 June 2017

Mac Library folder and fonts...

Your Mac Is Hiding Your Library Folder
https://www.lifewire.com/g00/os-x-is-hiding-your-library-folder-2260833?i10c.referrer=https%3A%2F%2Fwww.lifewire.com%2Fg00%2Fhow-to-manually-install-fonts-on-mac-2260815%3Fi10c.referrer%3Dhttps%253A%252F%252Fwww.google.co.uk%252F



Adding a font manually

https://www.lifewire.com/g00/how-to-manually-install-fonts-on-mac-2260815?i10c.referrer=https%3A%2F%2Fwww.google.co.uk%2F

Thursday 29 June 2017

Selected links from browser...

Testing

  • https://tgmstat.wordpress.com/2013/06/26/devtools-and-testthat-r-packages/
  • http://r-pkgs.had.co.nz/tests.html
  • https://itsalocke.com/the-making-of-datasaurus/

  • https://cran.r-project.org/web/packages/purrr/purrr.pdf
  • https://cran.r-project.org/web/packages/httr/vignettes/quickstart.html

ggplot extension
http://www.ggplot2-exts.org/gallery/

link to uniprot api
https://www.ebi.ac.uk/proteins/api/doc/#/proteins

stargazer - to make output from R prettier?
https://www.princeton.edu/~otorres/NiceOutputR.pdf

plotting polygon 
https://github.com/tidyverse/ggplot2/wiki/plotting-polygon-shapefiles

Ope's package
https://cran.r-project.org/web/packages/PLSbiplot1/index.html


Dot plots in R
http://www.sthda.com/english/wiki/ggplot2-stripchart-jitter-quick-start-guide-r-software-and-data-visualization
http://www.eighteenchains.com/lake-chad-basin
https://stackoverflow.com/questions/35226008/add-pair-lines-in-r

Wednesday 28 June 2017

Managed to plot output from multiple from base R and ggplot... not perfect yet...

 This is the output - 3 rel sequences in base R


This is the output - 3 rel sequences in ggplot2 using geom_rect()


Good - some progress...



Three human rel proteins



Q04864 (REL_HUMAN)

 
Q04206 (TF65_HUMAN)

Q01201 (RELB_HUMAN)

proteins_acc <- c("Q04864", "Q04206", "Q01201")

For the API, no spaces between the commas

Tuesday 27 June 2017

Plan to extend drawProteins to draw multiple proteins (and testing)....

Challenges to think about in terms of drawing multiple proteins 

So test case:
Draw three rel A family members:

(do we want one data.table for each or all three combined? but then we have a name for each protein)...

Need to arrange names on left (default) - option on right or space more?

Divide window vertically by three (number of proteins)..
Scale y axis to longest
Conserve colour of domains - how.

Other ideas:

  • add a custom domain 
  • Add other PTMs, conflicts, etc....
  • Change plotting so domains are slightly wider than chain. 
  • Colour chain... 
  • Scale by area not length...



N.B. What about p105? Two isoforms? How does my API handle this?
TEST/investigate

N.B. Better to focus on improving minimal deliverable unit rather than getting into interactions at this time, I think...



For testing - have some data within github - within package
For example a JSON object...
Transform it into a data.table
Check that they are the same....

Can I get a plot object and check that?

drawProteins package...

So very excited that I have been able to make my first R package.

I've really enjoyed the learning curve.

More to do of course.

Testing, vignettes...

Draw multiple proteins, I suspect - play with API more?

I wonder about using ggplot as the output rather than base R.

I can probably use
geom_rect()
http://sape.inf.usi.ch/quick-reference/ggplot2/geom_rect

maybe :
https://stackoverflow.com/questions/6862742/draw-a-circle-with-ggplot2
geom_circle() in the ggforce package....

Somebody else grappling with this....:
http://dozenoaks.ghost.io/ggplot2-to-plot-proteins/




Web pages with help about making packages...

Package Root

Got an error message about not being able to find "package root" because I hadn't got the path to the package.
Need to point to the path that contains the package file and all the documentation.
At the moment, I am loading from github not local.


Roxygen tags and NAMESPACES


My first deploy gave me functions from one .R file but not the other.
I needed to add info to the NAMESPACES. This is done by Roxygen but requires the addition of Roxygen tags.
Link about NAMESPACES here:
http://r-pkgs.had.co.nz/namespace.html

Link about Roxygen tags here:
http://kbroman.org/pkg_primer/pages/docs.html

Key was the addition of a Roxygen tag  to each function in the .R file.
#' @export

Detail in the Workflow section on Hadley's Packages book:
http://r-pkgs.had.co.nz/namespace.html#namespace-workflow

Cut and paste:
"The workflow is the same:
  1. Add roxygen comments to your .R files.
  2. Run devtools::document() (or press Ctrl/Cmd + Shift + D in RStudio) to convert roxygen comments to .Rd files.
  3. Look at NAMESPACE and run tests to check that the specification is correct.
  4. Rinse and repeat until the correct functions are exported."

Still have lots to do. Most importantly testing, vignettes and licencing. 

Useful blog post here: 


Stef's post (very inspiring):


Next steps:
  • Adding testing:  http://r-pkgs.had.co.nz/tests.html
  • Adding Vignette






Wednesday 7 June 2017

Interesting link about making maps in R...

http://eriqande.github.io/rep-res-web/lectures/making-maps-with-R.html

Also talks about ggmap


Making all the different graphs use the same scale ...

Use the
limits=c(1, 8)
argument.

https://stackoverflow.com/questions/21537782/how-to-set-fixed-continuous-colour-values-in-ggplot2

Saturday 13 May 2017

Tips and questions re mapping...

First key point is that simplifying the map is a really good idea.

package: rmapshaper
function: ms_simplify
Code: gadmNabS <- ms_simplify(gadmNab, keep = 0.01)

N.B. Plots much faster and looks OK.
Need to play and optimise this.


Issues re "gpclib" to bind names into the object with tidy()
http://stackoverflow.com/questions/21093399/how-to-turn-gpclibpermit-to-true





Some other links about this:

http://stackoverflow.com/questions/12629647/adding-geom-path-and-geom-text-to-the-same-ggplot-generates-error-in-r

https://gis.stackexchange.com/questions/43543/how-to-calculate-polygon-centroids-in-r-for-non-contiguous-shapes

http://ggplot2.tidyverse.org/reference/coord_map.html

http://ggplot2.tidyverse.org/reference/scale_gradient.html

http://stackoverflow.com/questions/6181653/creating-a-more-continuous-color-palette-in-r-ggplot2-lattice-or-latticeextra

http://ggplot2.tidyverse.org/reference/scale_brewer.html

http://stackoverflow.com/questions/21093399/how-to-turn-gpclibpermit-to-true





Microsoft Programming Link and another microcontroller

https://makecode.com/

Microbit
Circuit Playground Express

https://learn.adafruit.com/introducing-circuit-playground/overview

https://makecode.adafruit.com/

Getting Genetics Done Blog.

http://www.gettinggeneticsdone.com/2014/05/r-volcano-plots-to-visualize-rnaseq-microarray.html

ggplot2 repel labels.

Repelling labels in ggplot2
https://www.r-bloggers.com/repel-overlapping-text-labels-in-ggplot2/

https://cran.r-project.org/web/packages/ggrepel/vignettes/ggrepel.html

Selection of possible data sources and links

Relevant to Case 17 could be useful for a visualisation. 

Type 2 diabetes in South Asians: similarities and differences with white Caucasian and other populations

https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3715105/




The genetic architecture of type 2 diabetes

https://www.nature.com/nature/journal/v536/n7614/full/nature18642.html#supplementary-information


Different medical professionals
http://www.nhs.uk/Conditions/chiropractic/Pages/Introduction.aspx
http://www.nhs.uk/livewell/foothealth/pages/foot-problems-podiatrist.aspx







API Stuff
Swagger
http://swagger.io/


Global Burden of Disease Reports
http://www.who.int/healthinfo/global_burden_disease/GlobalDALYmethods_2000_2015.pdf?ua=1

Global Health Observatory 
Map Gallery

http://gamapserver.who.int/mapLibrary/app/searchResults.aspx

http://gamapserver.who.int/mapLibrary/Files/Maps/Global_LifeExpectancy_female_2015.png


Community Conference
https://csvconf.com/
A community conference for data makers everywhere
Featuring stories about data sharing and data analysis from science, journalism, government, and open source.



Friday 21 April 2017

Interesting paper with some data in it....

http://www.jimmunol.org/content/early/2017/03/22/jimmunol.1700003/tab-figures-data

mental wellness wearable

http://mindyourself.io/

Data Viz Book Club

https://public.tableau.com/en-us/s/blog/2017/03/introducing-our-data-viz-book-club


Selected R resources...

http://docs.ggplot2.org/current/vignettes/extending-ggplot2.html

http://kbroman.org/knitr_knutshell/pages/Rmarkdown.html

https://user2017.brussels/tutorials

Some health data from here:
http://www.publichealthwalesobservatory.wales.nhs.uk/home
inc some Tableau exploration tools:
https://public.tableau.com/profile/publichealthwalesobservatory#!/vizhome/PHOFlocalauthorityandhealthboardtool/Home?:iid&:tabs=no



Is there a way to include/publicise/promote my R training in any of these places?:
http://www.learningandwork.org.uk/
http://thenode.biologists.com/


Geomapping - some interesting links...

https://geographicdatascience.com/


http://www.alex-singleton.com/R-Tutorial-Materials/7-converting-coordinates.pdf


https://www.students.ncl.ac.uk/keith.newman/r/maps-in-r

https://cran.r-project.org/doc/contrib/intro-spatial-rl.pdf

http://stackoverflow.com/questions/24136868/plot-map-with-values-for-countries-as-color-in-r

The package 'leaflet'

The R package leaflet should allow the generation of a javascript object that I could use.

This is relevant to the Electives World Map that needs updating - ideally before Monday!!!!

For extra info: https://rstudio.github.io/leaflet/

API resources

R-bloggers blog piece:
https://www.r-bloggers.com/accessing-apis-from-r-and-a-little-r-programming/



Other access to Uniprot:
http://bioconductor.org/packages/release/bioc/html/UniProt.ws.html



EBI webservices:
http://www.ebi.ac.uk/Tools/webservices/

Thursday 20 April 2017

List of possible API to use...

Search google with API and EBI (european bioinformatics institute)

List of services
http://www.ebi.ac.uk/Tools/webservices/


Protein Data Bank
http://www.ebi.ac.uk/pdbe/pdbe-rest-api
PDBe’s REST API is a programmatic way to obtain information from the PDB and EMDB
3D biomacromolecular structures



Who else uses the REST API

The popular 3D viewer Jmol/JSmol has already integrated the REST API calls for quality and cross-references. Jalview, Coot and CCP4 developers have expressed interest.
Python example: https://github.com/PDBeurope/PDBe_Programming

Proteins API

https://www.ebi.ac.uk/proteins/api/doc/
https://academic.oup.com/nar/article-lookup/doi/10.1093/nar/gkx237

Ontology API

https://www.ebi.ac.uk/ols/docs/api


Don't forget:
Uniprot Web services R package:
http://bioconductor.org/packages/release/bioc/html/UniProt.ws.html


Wednesday 8 March 2017

Making a small change to github...

Yesterday, Stef Locke, showed me how to make a small change in Github.

Go to the file you want to change:

Press on the pen symbol.








Github will automatically create a fork and show this message:

You’re editing a file in a project you don’t have write access to. Submitting a change to this file will write it to a new branch in your fork brennanpincardiff/praise, so you can send a pull request.


Add the text you want to add...
Complete the Propose File Change format:



Then create "Pull Request":


Done...

I've been practicing on the R package called praise:
https://github.com/rladies/praise/

Tuesday 7 March 2017

Data Viz for Medical students...

I am planning to talk to Year 1 Medical students next year about data analysis & visualisation.

I am thinking about a new blog around the subject.

Here are some resources, I have found:

Analyzing health data, generating and communicating evidence to improve population health
http://publichealthintelligence.org/content/resources/data-tools



Gov.uk
Visualisations about immunisation
https://www.gov.uk/government/collections/immunisation#infographics

Friday 20 January 2017

How to download an R package from github...

https://cran.r-project.org/web/packages/githubinstall/vignettes/githubinstall.html

Need dev tools first:

library(devtools)

then use the install_github() function
install_github("hadley/dplyr")

There is a difference between install.packages() and install_github() in the required argument. install.packages() takes package names, while install_github() needs repository names. It means that when you want to install a package on GitHub, you must remember its repository name correctly.


I want to work out how to load ggphylo....
https://github.com/gjuggler/ggphylo



Monday 16 January 2017

Some R life expectancy resources...

I did a search and found the following interesting things:


  • https://www.r-bloggers.com/building-a-life-table/
  • https://www.r-bloggers.com/change-in-life-expectancy-animated-with-geo-charts/
  • https://www.r-bloggers.com/escalating-life-expectancy/
    • package: lifespan
  • http://stackoverflow.com/questions/28633849/life-expectancy-survival-package-r
  • https://www.r-bloggers.com/eu-life-quality-geo-report/


I can find papers that show hazard ratios and some which calculate changes in life expectancy. 

However, I'm not clear how to relate all this to an infographic. 

Inspiration from Spiegelhalter's blog: https://understandinguncertainty.org/davidsblog