Skip to content

Instantly share code, notes, and snippets.

View charanhu's full-sized avatar

Charan H U charanhu

View GitHub Profile
@charanhu
charanhu / rprog-quiz1.txt
Created September 14, 2020 12:12 — forked from kfeoktistoff/rprog-quiz1.txt
R Programming: Quiz1
1
The R language is a dialect of which of the following programming languages?
S
2
The definition of free software consists of four freedoms (freedoms 0 through 3). Which of the following is NOT one of the freedoms that are part of the definition?
The freedom to prevent users from using the software for undesirable purposes.
3
In R the following are all atomic data types EXCEPT
1
Take a look at the 'iris' dataset that comes with R. The data can be loaded with the code:
library(datasets)
data(iris)
A description of the dataset can be found by running
?iris
Selection: 6
|
| | 0%
| In this lesson, we'll see how to extract elements from a vector based on some
| conditions that we specify.
...
@charanhu
charanhu / bin_op.R
Created September 15, 2020 02:21 — forked from seankross/bin_op.R
Swirl R Programming Script Answers
"%p%" <- function(left, right){
paste(left, right)
}
@charanhu
charanhu / assignment1.md
Created September 15, 2020 03:04 — forked from mGalarnyk/assignment1.md
R Programming Programming Assignment 1 (Week 2) John Hopkins Data Science Specialization Coursera for the github repo https://github.com/mGalarnyk/datasciencecoursera

R Programming Project 1

github repo for rest of specialization: Data Science Coursera

For this first programming assignment you will write three functions that are meant to interact with dataset that accompanies this assignment. The dataset is contained in a zip file specdata.zip that you can download from the Coursera web site.

Although this is a programming assignment, you will be assessed using a separate quiz.

The zip file containing the data can be downloaded here: specdata.zip [2.4MB]

election: 12
|
| | 0%
| Whenever you're working with a new dataset, the first thing you should do is look at it! What is the format of the data? What are the dimensions? What are the
| variable names? How are the variables stored? Are there missing data? Are there any flaws in the data?
...
Selection: 15
|
| | 0%
| One of the greatest strengths of R, relative to other programming languages, is the ease with which we can create publication-quality graphics. In this lesson,
| you'll learn about base graphics in R.
@charanhu
charanhu / quiz3.md
Created September 15, 2020 05:40 — forked from mGalarnyk/quiz3.md
Getting and Cleaning Data Quiz 3 (Week 3) John Hopkins Data Science Specialization Coursera for the github repo https://github.com/mGalarnyk/datasciencecoursera/tree/master/3_Getting_and_Cleaning_Data

Getting and Cleaning Data Quiz 3 (JHU) Coursera

Question 1

The American Community Survey distributes downloadable data about United States communities. Download the 2006 microdata survey about housing for the state of Idaho using download.file() from here:

https://d396qusza40orc.cloudfront.net/getdata%2Fdata%2Fss06hid.csv

and load the data into R. The code book, describing the variable names is here:

# credits : https://www.kaggle.com/julian3833/1-quick-start-read-csv-and-flatten-json-fields
def load_df(csv_path, nrows=None):
'''Just loads the data and flattens the json fields. returns the data frames by converting json files into data frames'''
JSON_COLUMNS = ['device', 'geoNetwork', 'totals', 'trafficSource'] # we are definig a list of json column names
df = pd.read_csv(csv_path,
converters={column: json.loads for column in JSON_COLUMNS}, # It will create JSON object for every json column
dtype={'fullVisitorId': 'str'}, # we are considering 'fullvisitor id as string'
#include <iostream>
using namespace std;
int main() {
cout << "Hello, I'm Charan H U!";
return 0;
}