As mentioned before, this course is not aimed towards being a thorough course on programming languages. We will be using the three languages for some examples, however. As such, a basic knowledge of the commands will come in handy to be able to follow the exercises.
To have the version 10 or above installed and running is enough.
Installing Python version 3.7 with anaconda, and R 3.5.1 (with RStudio). Additionally, most of the examples and exercises will be shown running in atom (follow this guide to setup the Hydrogen kernels to run the packages from within the IDE).
(* Moving the library.m file to the folder: /Users/User/Library/Mathematica/Applications/ *)
Note: to install the anaconda image, follow the instructions on this README file.
# Using anaconda on terminal
source activate dataViz
pip install packageName
conda install packageName
install.packages(libraryName)
<<LibraryName`
import LibraryName
import LibraryName as Shorthand
library("LibraryName")
SetDirectory[NotebookDirectory[]]
rawData=Import["filename.csv"]
import numpy as np
# Through numpy
path = "/DIRECTORY/"
rawData = np.genfromtxt(path + 'filename.csv', delimiter=',')
path = "/DIRECTORY/"
setwd(path)
readData = read.csv2(paste0(path,"deterministicData.csv"), sep=",", header=FALSE, dec=".")
This quick reference shows the ways to access elements in a matrix form.
Please follow this guide for a quick rundown on the most common ways to access elements in arrays.
For dataframe manipulation please refer to this guide. In the case of vectors, please follow this rundown.
Export["filename.csv",data]
# Through Numpy
np.savetxt("foo.csv", a, delimiter=",")
write.csv(data, file = "filename.csv",row.names=FALSE)
Export["filename.extension", plotVariableName, ImageResolution->resolution, ImageSize->size]
import plotly
import plotly.io as pio
# Static Media
pio.write_image(figure, 'filename.png')
# HTML
plotly.offline.plot(figure, filename='alleleFrequencyPython.html')
library(htmlwidgets)
# Static Media
pdf("filename.extension", width = 4, height = 4)
plotRoutine()
dev.off()
# HTML
htmlwidgets::saveWidget(media, "filename.html")