Kategorien
Data Science

Connect RStudio to an access database (x64 bit)

When working with larger datasets you are frequently confronted with an access database. In this post, I will show you that it is very easy to connect RStudio to different databases.

First you need to load the required package/ install it when you don’t have it yet.

install.packages("RODC")
require(RODC)

In a next step you neet to set up the connection to your database. This can be done in one line of code:

con<-odbcDriverConnect("Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=C:/Users/lliebi/Dropbox/Daten Luca/PhD/other Projects/Run python in R/Test.accdb")

Notice for your purpose you just need to change the path to your file. Simply replace the string after (DBQ= ) with your specific file path.

Having connected to the database you will see the connection in the global environment. 

If you want to read data from the database use sqlFetch:

data <- sqlFetch(con, "Tabelle1")

You can also write into the database (e.g. after having done some analysis). This could also be very helpful when your crawling data from the web, save it in the database and at the same time read it from it.

sqlSave(con,as.data.frame(test), tablename="Table2")

I remember when I worked the first time with access databases and it took me quite a while to access the data. However, I hope that this small tutorial will help you when you are confronted with such a problem.

 

 

Kategorien
Hobbies

The risks of BASE jumping

BASE jumping has become a widely known extreme sport through media coverage. Influenced through social media the public associates BASE jumping as an extremely dangerous sport with a high death rate. This blog tries to shed some light into the dangers of BASE jumping.
As a reference, I recommend the book „The Great Book of Base“.

BASE stands for „Bridge, Antenna, Span and Earth“ and as the word implies BASE jumpers usually jump from one of these objects. Comparing BASE jumping to skydiving there are several crucial differences from which additional risks arise:

In skydiving, I usually jump from 14’500ft whereas in BASE you will be jumping from a much lower altitude (~2’000ft). As the freefall time decreases you will have less time to deal with problems concerning your body position in freefall and canopy opening issues. As a BASE jumper you will be concerned about your canopy opening. Imaging your jumping from a cliff and when your canopy opens it turns against the cliff. Such scenarios happen from time to time (cf. here). Such a risk does not arise in skydiving as you are in an empty space where you will not hit any buildings, cliffs or antennas. So on what does a smooth canopy opening depend on? In skydiving, it depends mostly on how your canopy was packed (accounts for roughly 70%). The remaining 30% depend on your body position. However, even if you have line twists during a skydive you will have time to solve such issues as you bill be 4000ft above the ground. Furthermore, you will have a reserve parachute that opens faster than your main canopy – so you will have a backup plan when everything goes wrong.

In contrast, in a BASE jump, you have no reserve canopy, open your parachute much lower and have less time to fix issues under your canopy. Due to the fact, that you will have less freefall speed in a BASE jump compared to a skydive the opening of your canopy depends to 60% on your body position and only 10% on your pack job. Other factors that play a key role are the weather, your equipment, and random factors during your jump.