In today’s open lab, we didn’t cover a lot. We first looked at how to generate random samples with certain conditions. Then we did an easy example of linear regression in R. The purpose of this lab is to let attendants understand how randomness works in R and how to use linear regression model for […]
Category: Open Lab
R Open Lab Fall 2018 – R Shiny
If you still haven’t got any idea of how amazing and powerful R can be, here is the time. In this open lab, I introduce my favourite part of R —- R shiny, which is a package to bulid interactive web app for data visualization, dashboard, map interaction and so on. I start from showing […]
Python Open Lab November 9
This week we learned pandas, which is a package built on top of Numpy. It has Dataframe as its core data structure which is very useful for dealing with table data. Dataframe is made up of multidimensional arrays with rows and columns. It supports heterogeneous types and missing data, which is a great feature. Pandas […]
R Open Lab Fall 2018 – Data manipulation
Today we covered the topic of data manipulation. We first reviewed the basic ways to subset data frames such as logical expression and subset function. Then, we looked at ways to combine, merge, and split data frames. Finally, we covered the usage of package plyr. Here is the link to our open lab’s GitHub repository: https://github.com/wbh0912/R-Open-Lab-Fall-2018 […]
Python Open Lab November 2
This week we learned about File IO. IO means input and output. So the content is basically about reading and writing file. Before doing any operations on file, we need to open the file. The command is open(filename, mode). ‘filename’ need to include the path of file. There are two ways to show the path, […]
Python Open Lab October 26
This week we learned functions, which is very important for programmers. Functions are useful for procedural decomposition, maximize code reuse and minimize redundancy. Functions should be declared like a variable before using. def function(parameter1, parameter2…): do something return value ‘def’ is the keyword to show that we are defining a function. ‘function’ can be replaced […]
Python Open Lab October 19
This week we mainly learned about condition statements. First we learned how to read user-input from console by using function input(). Input() can introduce user input to our program so user can define some values and program can get that. Then we looked at the definition of condition statement, which means when condition is met, […]
Python Open Lab October 12
In this week, we continue to learn string, which is very important. Loop is also introduced. Examples like loop for a list, loop for a dictionary or loop for a string are taught. We learned some useful functions of string. len(str) — find the length of present string str.find(“ab”) — search a string in present […]
R Open Lab Fall 2018 – Text data in R
R is also a powerful tool to deal with text data. This time we first clarified the concept between character and string by practicing some tricky examples and some basic ideas that we can play with our text data such as substring, combining and replacing. Then a txt file was introduced to let attendee play […]
R Open Lab Fall 2018 – More visualization
Today we will explore more about the advanced data visualization in R. First, we will review the basic graphical functions covered in the last open lab and learn how to use additional parameters to achieve different goals. Then, we will focus on the powerful package ggplot2. Here is the link to our open lab’s GitHub repository: https://github.com/wbh0912/R-Open-Lab-Fall-2018 If […]