05 Data structure
The radar basics - get to know your data, storing results, calibrating
Data structure
Since we already encountered multiple data sets during this course it is good to keep an organized system. For your final seminar assignment this will help you to stay on top of your data. The system we are using today is recyclable for any other future geographical work. At the moment our template looks like this a folder with the project name and three sub-folders called: data, output and scripts. Moving forward we will have original data an processed data files. Lets put two more sub-folders to data called raw and prc for processed data. This way you will never lose your original data and can always fall back and do not need to search and download the data set again.
Hence, this is how your data structure could look like this:
<some-path-to-your-data-disk>\ground_radar_seminar
|-- project_burrowsystem
|-- data
|-- raw
|-- prc
|-- scripts
|-- output
|
Making path connections
There are multiple ways to structure your working environment and folder connections. Today we are showing you one way how to do it. But as you come across help pages and browser searches for different kinds of problems you will see that everyone has a little differnet system. We recommend to start using the proposed ideas for starting your journey in the R language.
#make base path
filepath_base <-("C:/yourname/documents/radar_seminar/template_project")
#set underlying connections
path_data<-paste0(filepath_base, "/data")
raw<-paste0(path_data, "/raw/")
prc<-paste0(path_data, "/prc/")
output<-paste0(filepath_base, "/output/")
#instead of always writing
#e.g.
png(file=paste0("C:/Users/yourname/documents/radar_seminar/output/testline_plot.png",
width=600, height=350)
#now
png(file=paste0(output,"testline_plot.png"),
width=600, height=350)
Difference between paste and paste0
Some little helpful functions
#clean environment
rm(list=ls())
#session restart
.rs.restartR()
#remove plots
dev.off()
Read in GPR data with paste0
#load data
x <- readGPR(paste0(raw,"yyline3.DT1"))