Dealing with different file encodings for a set of data can be a bit of a pain [1], but there is one tool that is really useful in this situation. Using the readr-package[2] with its guess_encoding-function for reading files works most of the time. A few additions can make it even better.

Read More

Rpubs is a free service for publication of html-reports from R. Typically, the service is used to publish research. If you are working with R from the command line, there is a method for publishing to Rpubs – rpubsUpload.

Read More

Order, Order, Order

If you have done any major R-project, you quickly get to the point where it is hard to keep everything ordered – your scripts, you data, your output, your tests… If you have done several major R-projects, you know how hard it is to keep a similar structure and workflow between projects. The end result can be that projects are hardly reproducible, because you confuse others with a lack of order in each project, and a different order – to the degree that you have any order – from one project to the next.

Read More

To get our bearings in the Natura 2000 data, we need to run a range of commands on each table, such as dim() and summary(). Since eventual changes in the table from one year to the next – and in particular any change that makes one table incomparable to others across years – are of interest, we need to run the commands on all the tables across all years and present the data for comparation. To achieve this, it is better to do it with a script rather than manually, given the number of tables involved, and the supposed similarity of the data structures.

Read More

To be able to analyze the data from Natura 2000, the first step is to get the data from the Natura 2000 page ([1],[2],[3],[4],[5],[6],[7]). When acquiring data from any source, it is important to keep in mind that everything you do should be transparent and traceable. This can be done by either documenting each step properly or making an easy-to-read script that handles the steps involved, or both. Why is it important to ensure transparency and traceability? The most important reasons are to be able to prove that the basis for your analysis comes from the data sources that you say they come from and to be able to spot possible errors in the analysis.

Read More