Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
516 commits
Select commit Hold shift + click to select a range
25f114c
setup java
chankeypathak Aug 22, 2020
21c8573
order
chankeypathak Aug 22, 2020
bdfaac7
grammar
chankeypathak Aug 22, 2020
5d31b4c
R intro
chankeypathak Aug 22, 2020
aa307d6
remove grabage
chankeypathak Aug 22, 2020
bc45a9c
Merge pull request #24 from chankeypathak/master
chankeypathak Aug 22, 2020
58c7a48
Update introduction.md
chankeypathak Aug 22, 2020
b3303e7
android tether
chankeypathak Aug 22, 2020
1f9af5f
Merge remote-tracking branch 'upstream/master'
chankeypathak Aug 22, 2020
574fa59
Merge pull request #25 from chankeypathak/master
chankeypathak Aug 22, 2020
bee8962
Update introduction.md
chankeypathak Aug 22, 2020
89faeb2
Update classes-objects.md
chankeypathak Aug 22, 2020
3878f29
Update android-tethering.md
chankeypathak Aug 22, 2020
6dec2a0
generics
chankeypathak Aug 23, 2020
730a7bb
generics 2
chankeypathak Aug 23, 2020
fe9c521
generics 3
chankeypathak Aug 23, 2020
3e597d0
generics 4
chankeypathak Aug 23, 2020
5600a5b
Merge pull request #26 from chankeypathak/master
chankeypathak Aug 23, 2020
ea7ecf9
Update generics-in-java.md
chankeypathak Aug 23, 2020
a7a6502
change ex
chankeypathak Aug 24, 2020
6e93578
Cplusplus
chankeypathak Aug 24, 2020
c04a6c5
cpp
chankeypathak Aug 24, 2020
fa2142b
Merge pull request #27 from chankeypathak/master
chankeypathak Aug 24, 2020
89c1d17
desc
chankeypathak Aug 24, 2020
b5efa1d
r test
chankeypathak Aug 25, 2020
54d6bc6
dsa
chankeypathak Aug 25, 2020
2b0c1a7
dsa images
chankeypathak Aug 25, 2020
31d17bb
Merge pull request #28 from chankeypathak/master
chankeypathak Aug 25, 2020
352411e
constructor
chankeypathak Aug 26, 2020
243b017
table
chankeypathak Aug 26, 2020
47cd7ed
Merge pull request #29 from chankeypathak/master
chankeypathak Aug 26, 2020
106b6a6
Update constructors.md
chankeypathak Aug 26, 2020
4967616
Create _index.md
chankeypathak Aug 26, 2020
1143064
Update _index.md
chankeypathak Aug 26, 2020
9c3fdb0
Delete index.html
chankeypathak Aug 26, 2020
0782fd9
Delete _index.md
chankeypathak Aug 26, 2020
fa62274
Create index.html
chankeypathak Aug 26, 2020
298c797
Update constructors.md
chankeypathak Aug 26, 2020
ea8df57
Update config.toml
chankeypathak Aug 26, 2020
5e5a8cf
Delete index.html
chankeypathak Aug 26, 2020
2f87cf3
Create index.html
chankeypathak Aug 26, 2020
764719d
Update classes-objects.md
chankeypathak Aug 26, 2020
dabc119
Update constructors.md
chankeypathak Aug 26, 2020
c2ca0d0
Update constructors.md
chankeypathak Aug 26, 2020
d8a3655
Update introduction.md
chankeypathak Aug 26, 2020
6f9da22
Update introduction.md
chankeypathak Aug 26, 2020
8eda783
python
chankeypathak Aug 26, 2020
d20eea5
menu ordering
chankeypathak Aug 26, 2020
2c17e11
Update introduction.md
chankeypathak Aug 28, 2020
91091a7
Merge remote-tracking branch 'upstream/master'
chankeypathak Aug 28, 2020
955ee12
update
chankeypathak Aug 28, 2020
5a28651
Merge pull request #30 from chankeypathak/master
chankeypathak Aug 28, 2020
6b086f1
python image
chankeypathak Aug 28, 2020
f7d19fd
Merge remote-tracking branch 'upstream/master'
chankeypathak Aug 28, 2020
a68afea
questdb
chankeypathak Aug 28, 2020
8f2b20f
questdb2
chankeypathak Aug 28, 2020
c983b1a
questdb3
chankeypathak Aug 28, 2020
1a8148e
label
chankeypathak Aug 28, 2020
dcada6c
Merge pull request #31 from chankeypathak/master
chankeypathak Aug 28, 2020
aee5472
meta
chankeypathak Aug 28, 2020
0c6c724
Update questdb-python.md
chankeypathak Aug 28, 2020
af00d43
Merge remote-tracking branch 'upstream/master'
chankeypathak Aug 28, 2020
194059a
stdout
chankeypathak Aug 28, 2020
8d4aa14
stdout 2
chankeypathak Aug 28, 2020
9e5119f
Update QuestDB.ipynb
chankeypathak Aug 28, 2020
53ee66c
exception
chankeypathak Aug 28, 2020
d1212bb
delete exception
chankeypathak Aug 28, 2020
58c38b9
Merge remote-tracking branch 'upstream/master'
chankeypathak Aug 28, 2020
d4e569c
exception
chankeypathak Aug 29, 2020
fc71680
java
chankeypathak Aug 29, 2020
9d30dc1
java2
chankeypathak Aug 29, 2020
e6eb16a
throw thows
chankeypathak Aug 30, 2020
079f89f
pm skills
chankeypathak Aug 31, 2020
009c51d
pm skills2
chankeypathak Aug 31, 2020
154b70c
meta
chankeypathak Aug 31, 2020
b9868b0
Merge pull request #32 from chankeypathak/master
chankeypathak Sep 1, 2020
ff36f49
Update project-manager-skills.md
chankeypathak Sep 1, 2020
52e1557
finally
chankeypathak Sep 1, 2020
0752454
Merge remote-tracking branch 'upstream/master'
chankeypathak Sep 1, 2020
36754bd
regex
chankeypathak Sep 1, 2020
9a10e09
regex2
chankeypathak Sep 1, 2020
3d8439f
regex3
chankeypathak Sep 1, 2020
dfbc8cd
regex3
chankeypathak Sep 1, 2020
3d78f34
Update introduction.md
chankeypathak Sep 2, 2020
18b5270
Merge pull request #33 from chankeypathak/master
chankeypathak Sep 2, 2020
da858e2
Update questdb-python.md
chankeypathak Sep 2, 2020
87f33a4
average
chankeypathak Sep 2, 2020
bf2ed6f
link
chankeypathak Sep 2, 2020
09f79c9
Merge remote-tracking branch 'upstream/master'
chankeypathak Sep 2, 2020
7c2842f
sd
chankeypathak Sep 2, 2020
acef62a
var
chankeypathak Sep 2, 2020
7f16337
fix images
chankeypathak Sep 2, 2020
2c61b6b
fix images2
chankeypathak Sep 2, 2020
3b459cc
Merge pull request #34 from chankeypathak/master
chankeypathak Sep 2, 2020
114dd2c
Update regex.md
chankeypathak Sep 4, 2020
f0c353c
Update average.md
chankeypathak Sep 4, 2020
9c899c1
lambda
chankeypathak Sep 4, 2020
7dcdeda
Merge remote-tracking branch 'upstream/master'
chankeypathak Sep 4, 2020
05166e2
examples
chankeypathak Sep 4, 2020
69559a1
examples
chankeypathak Sep 4, 2020
f04b781
examples
chankeypathak Sep 4, 2020
e23616f
heap
chankeypathak Sep 4, 2020
6c93743
heap
chankeypathak Sep 4, 2020
76bb523
heap
chankeypathak Sep 4, 2020
9e43d21
heap
chankeypathak Sep 4, 2020
e80be13
merge
chankeypathak Sep 4, 2020
2a47491
update class
chankeypathak Sep 4, 2020
8aec8f4
desc
chankeypathak Sep 4, 2020
8dad014
images
chankeypathak Sep 4, 2020
80a5b96
desc
chankeypathak Sep 4, 2020
c51e434
finally
chankeypathak Sep 4, 2020
62aa3a8
image
chankeypathak Sep 4, 2020
4459409
Merge pull request #35 from chankeypathak/master
chankeypathak Sep 4, 2020
da01e6c
url
chankeypathak Sep 4, 2020
fe24b6f
Merge remote-tracking branch 'upstream/master'
chankeypathak Sep 4, 2020
4fc9e8a
fix url
chankeypathak Sep 4, 2020
5271ee0
wrapper
chankeypathak Sep 5, 2020
653a463
wrapper
chankeypathak Sep 5, 2020
47facc2
deco
chankeypathak Sep 8, 2020
d6688cd
annotations
chankeypathak Sep 8, 2020
4f67dd7
insertion
chankeypathak Sep 8, 2020
b3b1869
fix
chankeypathak Sep 8, 2020
1f36192
bst
chankeypathak Sep 8, 2020
5811f9b
documented
chankeypathak Sep 8, 2020
5aef83e
documented
chankeypathak Sep 8, 2020
b8bc69c
r install
chankeypathak Sep 8, 2020
c63ab20
r install
chankeypathak Sep 8, 2020
380ce00
Merge pull request #36 from chankeypathak/master
chankeypathak Sep 8, 2020
2e76a66
order
chankeypathak Sep 8, 2020
0b40e3c
regex update
chankeypathak Sep 8, 2020
921279b
regex update
chankeypathak Sep 8, 2020
ce6d910
lam
chankeypathak Sep 8, 2020
8c2516c
python ex
chankeypathak Sep 8, 2020
80df442
python ex
chankeypathak Sep 8, 2020
5ba7305
python ex
chankeypathak Sep 8, 2020
acd8c4b
java package
chankeypathak Sep 8, 2020
7089d26
remove package
chankeypathak Sep 8, 2020
a55c959
exception handling python
chankeypathak Sep 9, 2020
84964be
exception handling python
chankeypathak Sep 9, 2020
07076ae
exception handling python
chankeypathak Sep 9, 2020
48effc2
exception handling python2
chankeypathak Sep 9, 2020
8f2f534
exception handling python3
chankeypathak Sep 9, 2020
95e06f7
exception handling python3
chankeypathak Sep 9, 2020
4ecd30c
exception desc
chankeypathak Sep 9, 2020
707ffb5
Merge pull request #37 from chankeypathak/master
chankeypathak Sep 9, 2020
27b1e9a
serialization 1
chankeypathak Sep 10, 2020
7b08252
Update bst.md
chankeypathak Sep 13, 2020
a23d6de
Update insertion-sort.md
chankeypathak Sep 13, 2020
f7fb5ca
Update lambda.md
chankeypathak Sep 13, 2020
d0431c8
java serial
chankeypathak Sep 13, 2020
e831e0c
Merge remote-tracking branch 'upstream/master'
chankeypathak Sep 13, 2020
5c5985d
fix fbpost
chankeypathak Sep 14, 2020
dd687c4
serial
chankeypathak Sep 15, 2020
6e9b475
serial flow
chankeypathak Sep 15, 2020
d88013e
binary search
chankeypathak Sep 15, 2020
747deb1
desc
chankeypathak Sep 15, 2020
c040378
Merge pull request #38 from chankeypathak/master
chankeypathak Sep 15, 2020
bca2a45
sdkman
chankeypathak Sep 16, 2020
bbf580e
sdkman
chankeypathak Sep 16, 2020
55b573b
python config
chankeypathak Sep 16, 2020
00f0c73
config update
chankeypathak Sep 16, 2020
792007f
add links
chankeypathak Sep 16, 2020
8883ae8
fix gen
chankeypathak Sep 17, 2020
5a5128e
interpolation search
chankeypathak Sep 17, 2020
03519c3
static method overload
chankeypathak Sep 17, 2020
a380539
updates
chankeypathak Sep 17, 2020
a9b8cef
fix url
chankeypathak Sep 17, 2020
5562f8a
fix url
chankeypathak Sep 17, 2020
d6c7dfb
Update finally.md
chankeypathak Sep 17, 2020
07aaf22
Update throw-throws.md
chankeypathak Sep 17, 2020
e4b3753
Merge pull request #39 from chankeypathak/master
chankeypathak Sep 17, 2020
bf8ce01
Merge pull request #41 from TutsWiki/chankeypathak-patch-2-1
chankeypathak Sep 17, 2020
076f094
Merge pull request #40 from TutsWiki/chankeypathak-patch-2
chankeypathak Sep 17, 2020
0b143db
update
chankeypathak Sep 17, 2020
d548a60
Update robots.txt
chankeypathak Sep 17, 2020
cbc3541
Update grunt-tutorial.md
chankeypathak Sep 17, 2020
a9d8820
Update interpolation-search.md
chankeypathak Sep 17, 2020
1001106
Add files via upload
chankeypathak Sep 17, 2020
c58c6e1
Create garbage-collection.md
chankeypathak Sep 18, 2020
3ed067d
Update garbage-collection.md
chankeypathak Sep 18, 2020
f6552d0
Update garbage-collection.md
chankeypathak Sep 18, 2020
4118f6e
expo
chankeypathak Sep 22, 2020
adb0831
Update binary-search.md
chankeypathak Sep 22, 2020
5251a9a
fixes
chankeypathak Sep 23, 2020
10be565
threading
chankeypathak Sep 24, 2020
1bf6084
threading2
chankeypathak Sep 24, 2020
f3de114
threading3
chankeypathak Sep 24, 2020
96219ea
thread image
chankeypathak Sep 24, 2020
fdb45d1
thread fix
chankeypathak Sep 24, 2020
0db1b8e
thread cpp
chankeypathak Sep 25, 2020
f55e0e1
thread cplusplus
chankeypathak Sep 26, 2020
7cb33e0
Update exception-handling.md
chankeypathak Sep 26, 2020
07f2445
Update exception-handling.md
chankeypathak Sep 28, 2020
fa2ccc2
Update throw-throws.md
chankeypathak Sep 28, 2020
2889270
Update finally.md
chankeypathak Sep 28, 2020
aa4ed8d
psql java
chankeypathak Sep 28, 2020
248f445
psql java 2
chankeypathak Sep 28, 2020
b78aa43
psql java 3
chankeypathak Sep 28, 2020
88b2300
2.4
chankeypathak Sep 29, 2020
b5b44c9
quicksort
chankeypathak Sep 29, 2020
e360e28
Merge pull request #42 from chankeypathak/master
chankeypathak Sep 29, 2020
099bb87
Update quick-sort.md
chankeypathak Sep 29, 2020
aa567d6
ml api
chankeypathak Oct 8, 2020
5fce043
Merge remote-tracking branch 'upstream/master'
chankeypathak Oct 8, 2020
4546a2f
counting sort
chankeypathak Oct 8, 2020
4935543
functions cpp
chankeypathak Oct 13, 2020
5daec8e
modules python
chankeypathak Oct 13, 2020
9277095
ad
chankeypathak Oct 13, 2020
741eae2
Merge pull request #43 from chankeypathak/master
chankeypathak Oct 13, 2020
68cdde8
overload vs override
chankeypathak Oct 14, 2020
a0ae2d9
overload vs override 2
chankeypathak Oct 14, 2020
6ee1d4d
bucket sort
chankeypathak Oct 20, 2020
63e4611
medium alternatives
chankeypathak Oct 20, 2020
630a4c2
medium alternatives 2
chankeypathak Oct 20, 2020
555e38e
ad
chankeypathak Oct 20, 2020
a86ad47
medium changes
chankeypathak Oct 20, 2020
90a57c5
fix quotes
chankeypathak Oct 20, 2020
8795551
Merge pull request #44 from chankeypathak/master
chankeypathak Oct 20, 2020
ffc8e07
java collections
chankeypathak Oct 20, 2020
f49a22a
indent
chankeypathak Oct 20, 2020
321a6a0
highlight
chankeypathak Oct 20, 2020
3a1441b
highlight 2
chankeypathak Oct 20, 2020
43a5672
update copy icon
chankeypathak Oct 20, 2020
6bd162d
remove unwanted code
chankeypathak Oct 20, 2020
8c890af
closing div
chankeypathak Oct 20, 2020
572d79a
upgrade mermaid
chankeypathak Oct 20, 2020
e71ffcf
taxonomy fix in local build
chankeypathak Oct 20, 2020
618f026
Merge pull request #45 from chankeypathak/master
chankeypathak Oct 20, 2020
de50cff
c++ installation
chankeypathak Oct 22, 2020
8390d66
c++ installation date update
chankeypathak Oct 22, 2020
2f08fc1
radix
chankeypathak Oct 31, 2020
54a52f5
Merge pull request #46 from chankeypathak/master
chankeypathak Oct 31, 2020
778034f
deb install
chankeypathak Nov 1, 2020
82a3743
Merge remote-tracking branch 'upstream/master'
chankeypathak Nov 1, 2020
48c730c
deb install 2
chankeypathak Nov 1, 2020
462993b
link up
chankeypathak Nov 1, 2020
62b4160
update description
chankeypathak Nov 9, 2020
89d8bed
update description
chankeypathak Nov 9, 2020
bbf76b2
ml
chankeypathak Nov 9, 2020
3f1fa1e
bubble sort
chankeypathak Nov 13, 2020
0d2fec9
bubble sort
chankeypathak Nov 13, 2020
01eb779
bubble sort 2
chankeypathak Nov 13, 2020
8905131
bubble sort 3
chankeypathak Nov 13, 2020
51267a1
fixed identation
Brambor Nov 28, 2020
8ab3781
Merge pull request #48 from Brambor/patch-1
chankeypathak Dec 15, 2020
7bec080
Update abstract-classes-and-interfaces-in-python.md
chankeypathak Dec 15, 2020
65e78c8
Merge pull request #47 from chankeypathak/master
chankeypathak Jun 13, 2021
29c3eb2
chore: update QuestDB logo
bsmth Sep 30, 2021
974eed6
Merge pull request #50 from bsmth/master
chankeypathak Oct 1, 2021
50a21b8
Create SECURITY.md
Wbaker7702 Oct 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/public*
.idea*
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![wercker status](https://app.wercker.com/status/869c3599ae2b088beafa8aeca93b1483/s/master "wercker status")](https://app.wercker.com/project/byKey/869c3599ae2b088beafa8aeca93b1483)

# [TutsWiki.com](http://tutswiki.com)
# [TutsWiki.com](https://tutswiki.com)
Collaborative tutorials for the internet

![collaborate](https://github.com/TutsWiki/source/blob/master/static/img/collaborate.png "Collaborate")
21 changes: 21 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Security Policy

## Supported Versions

Use this section to tell people about which versions of your project are
currently being supported with security updates.

| Version | Supported |
| ------- | ------------------ |
| 5.1.x | :white_check_mark: |
| 5.0.x | :x: |
| 4.0.x | :white_check_mark: |
| < 4.0 | :x: |

## Reporting a Vulnerability

Use this section to tell people how to report a vulnerability.

Tell them where to go, how often they can expect to get an update on a
reported vulnerability, what to expect if the vulnerability is accepted or
declined, etc.
1 change: 1 addition & 0 deletions ads.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
google.com, pub-9878675755379402, DIRECT, f08c47fec0942fa0
12 changes: 6 additions & 6 deletions archetypes/default.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
+++
weight = 5
[menu]
[menu.main]
parent = "x"
+++
---
title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
draft: true
---

89 changes: 76 additions & 13 deletions config.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,79 @@
baseurl = "http://tutswiki.com/"
MetaDataFormat = "yaml"
disableHugoGeneratorInject = true

baseURL = "https://tutswiki.com/"
languageCode = "en-us"
title = "TutsWiki Beta"
theme = "tutswiki-theme-v2"
disqusShortname = "tutswiki"
# For search functionnality
[outputs]
home = [ "HTML", "RSS", "JSON"]
[markup]
defaultMarkdownHandler = "blackfriday"
[params]
description = "Collaborative tutorials for the internet"
author = "Chankey Pathak (@chankeypathak)"
# Prefix URL to edit current page. Will display an "Edit this page" button on top right hand corner of every page.
# Useful to give opportunity to people to create merge request for your doc.
# See the config.toml file from this documentation site to have an example.
editURL = "https://github.com/TutsWiki/source/edit/master/content/"
# Author of the site, will be used in meta information
author = "Chankey Pathak"
# Description of the site, will be used in meta information
description = "TutsWiki :: Collaborative tutorials for the internet"
# Shows a checkmark for visited pages on the menu
showVisitedLinks = false
# Disable search function. It will hide search bar
disableSearch = false
# Javascript and CSS cache are automatically busted when new version of site is generated.
# Set this to true to disable this behavior (some proxies don't handle well this optimization)
disableAssetsBusting = false
# Set this to true to disable copy-to-clipboard button for inline code.
disableInlineCopyToClipBoard = true
# A title for shortcuts in menu is set by default. Set this to true to disable it.
disableShortcutsTitle = false
# When using mulitlingual website, disable the switch language button.
disableLanguageSwitchingButton = true
# Order sections in menu by "weight" or "title". Default to "weight"
ordersectionsby = "weight"
# Change default color scheme with a variant one. Can be "red", "blue", "green".
themeVariant = ""

[[Languages.en.menu.shortcuts]]
name = "<i class='fas fa-tags'></i> Tags"
url = "/tags/"
weight = 5

[[Languages.en.menu.shortcuts]]
name = "<i class='fab fa-fw fa-github'></i> GitHub"
identifier = "ds"
url = "https://github.com/TutsWiki/source/"
weight = 10

[[Languages.en.menu.shortcuts]]
name = "<i class='fa fa-fw fa-bullhorn'></i> Credits"
url = "https://github.com/TutsWiki/source/graphs/contributors/"
weight = 30

[taxonomies]
tag = "tags"
group = "groups"
[[Languages.en.menu.shortcuts]]
name = "<i class='fab fa-fw fa-facebook'></i> Facebook"
url = "https://www.facebook.com/TutsWiki/"
weight = 30

[[menu.main]]
name = "Pandas Cookbook"
identifier = "pandas"
weight = -100
[privacy]
[privacy.disqus]
disable = false
[privacy.googleAnalytics]
anonymizeIP = false
disable = false
respectDoNotTrack = false
useSessionStorage = false
[privacy.instagram]
disable = false
simple = false
[privacy.twitter]
disable = false
enableDNT = false
simple = false
[privacy.vimeo]
disable = false
simple = false
[privacy.youtube]
disable = false
privacyEnhanced = false
13 changes: 13 additions & 0 deletions content/R/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: R
weight: 15
pre: "<b></b>"
chapter: true
description: A complete guide to R programming language.
---

### R

# Introduction

A complete guide to R programming language.
85 changes: 85 additions & 0 deletions content/R/average.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
date: 2020-09-02
linktitle: Average
menu:
main:
parent: R
next: /r/mean-median-mode
title: Calculating Average (Mean, Median, Mode) in R
weight: 26
url: /r/average-mean-median-mode
description: In this article we'll look at various measures of central tendencies like mean, median, mode and deviation of various sample values from the central point in the distribution.
keywords:
- R
tags: [R]
---
Statistics is a branch of mathematics that deals with numerical data analysis. Statistics is the study of the collection, analysis, organization, interpretation and presentation of data.

R language has been an excellent tool for statistical computation of data which includes statistical modeling, data oriented strategies and use of probability distribution and randomization in analysis. R provides various tools and functions to perform the statistical analysis of data with ease.

In this article we'll look at various measures of central tendencies like `mean`, `median`, `mode` and `deviation` of various sample values from the central point in the distribution.

## Average
An average is defined as the number in statistics that measures the central tendency of a given a set of numbers. The various types of averages that will be used in statistical computations are

- Mean
- Mode
- Median

Let's have a look at each of these measures of central tendency one by one.

### Mean
Mean is defined as the sum of all the observations divided by total number of sample observations. The basic formula for the mean of all the observations y1, y2, y3,…yn is given by

`X = y1+ y2 + y3 + ... + yn / n`

Let us consider an example of dataset containing 7 datapoints `3, 5, 7, 9, 11, 13, 15`

The Mean in this case would be `X = (3 + 5 + 7 + 9 + 11 + 13 + 15 ) / 7 = 9`

R provides an in-built function `mean()` to compute the mean of all values in the dataset. The function takes numeric or integer vector as an argument and returns the result.

![Mean in R](/images/R/R-mean.png "Mean")

- `x` is a variable that takes the integer vectors using `c()` function
- The result of `mean(x)` is displayed using `print`

#### Syntax of mean()
- `mean(x, na.rm)`

Here, `x` is the numeric/integer vector and `na.rm` is a `Boolean` value to remove `NA` (undefined values) from the given dataset.

### Mode
Mode is defined as a number in a set of numbers that occurs the most (maximum frequency) in the given dataset.

Let us consider an example of dataset containing 12 datapoints `2, 4, 6, 4, 9, 5, 4, 2, 4, 4, 2, 6`

In the above example, 4 has the maximum frequency among the set of numbers. Hence, 4 is the mode of this dataset.

R does not have an in-built function to compute the mode for a given set of numbers. So, a user defined function is created.

- `mode(x)` is a user defined function here.
- The body of the function contains call to `unique(x)` function to filter out all the duplicate elements and in the next step `which.max(tabulate(match(x,u)))` is contained in the body to determine the mode of the given dataset.
- `mode(x)` function is then invoked and return value is stored in the variable `result`

![Mode in R](/images/R/R-mode.png "Mode")

### Median
Median is defined as the middle value among the set of numbers when all the numbers are sorted.

- If the total numbers in dataset are odd, the median will lie at `(n+1)/2` location.
- If the total numbers in dataset are even, the medians will lie at `(n/2)` and `(n/2)+1` locations.

Let us consider an example of dataset containing 9 datapoints `3, 12, 4, 8, 15, 1, 23, 11, 7`

- Arrange the numbers in ascending order such that the above example looks like `1, 3, 4, 7, 8, 11, 12, 15, 23`.
- Find the middle value, that will be at `(9+1)/2` i.e. at 5th position. Hence, 8 is our median.

R provides an in-built function `median()` to compute the median or middle value of all values in the dataset. The function takes numeric or integer vector as an argument and returns the median value.

![Median in R](/images/R/R-median.png "Median")

- `x` is a variable that takes the integer vectors using `c()` function
- The result of `median(x)` is displayed using `print`

In the next section we'll look at [Variance](/r/variance)
66 changes: 66 additions & 0 deletions content/R/installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
date: 2020-08-22
linktitle: Installation
menu:
main:
parent: R
next: /r/basic_syntax
title: Installing R and RStudio in Windows & Linux
weight: 2
url: /r/install-env-setup
description: Detailed steps with screenshots on how to install R and RStudio IDE in Windows, Ubuntu and CentOS.
keywords:
- R
tags: [R]
---
R is a very popular and most interactive programming language and has been an important toolbox for Data Scientists and Business Analysts. To work and create projects on R, you just need to install two important tools– **R** and **RStudio**. Both of these software work in parallel to create various projects and Markdown Documents in R.

Installing R to a local computer consists of various easy steps. The steps for installation of R vary with different operating systems like Windows, Linux and MacOS. The official site for the installation [cloud.r-project.org](https://cloud.r-project.org) provides various pre-compiled binary versions and libraries for the above mentioned various operating systems. To install R, you can get the package either from the given official site or can use commands from the terminal or command prompt. In some Linux Distributions, R is installed by default, which you can easily verify by entering R in the console.

## Installing R in Windows

There are some steps you need to follow to install R and RStudio. Let's have a look at those steps.

1. Firstly you have to download R setup by directly clicking on the link https://cloud.r-project.org OR https://cran.r-project.org. You will be directed to a page containing downloads for various operating systems.
![Download R for Windows](/images/R/download-R-windows.png "Download R for Windows")
2. Click on "base" and then click on R for the first time, it will direct you to the page containing the latest version of R. Click on **Download R 4.0.2 for Windows** (This is the latest version as of this writing).
![Download R 4.0.2 for Windows](/images/R/download-R-402-windows.png "Download R 4.0.2 for Windows")
3. Once the download is finished, run the setup file.
4. License information will be displayed on the next screen. R uses GPL license. Click on Next.
![R GPL license](/images/R/R-license.png "R GPL license")
5. Select the path where we want to download our R Software and proceed to Next. ![Download R 4.0.2 for Windows](/images/R/R-install-path.png "Download R 4.0.2 for Windows")
6. Select all the components like 32 bit file, 64 bit file and core files which you want to install and then click on Next. ![R 32 and 64 bit files](/images/R/R-32-64-bit.png "R 32 and 64 bit files")
7. In the next step, we have to select either customized startup or we go on with the default and proceed to Next.
![R customized startup](/images/R/R-customized-startup.png "R customized startup")
8. On clicking next, the installation of R in our system will get started in the designated path.
![R Installing](/images/R/R-installing-step.png "R Installing")
9. At last, we will click on Finish to successfully install R in our system.
![R Setup Finished](/images/R/R-setup-finished.png "R Setup Finished")

## Installing RStudio IDE in Windows
1. [Download RStudio](https://rstudio.com/products/rstudio/download/) from the official website.
2. Download the free version by clicking on **Download RStudio**.
![R Setup Finished](/images/R/R-studio-various-versions.png "R Setup Finished")
3. In the next step, we will select the appropriate installer. When we select the installer, our downloading of RStudio will take place and setup will start.
![RStudio free version](/images/R/R-studio-free-version.png "RStudio free version")
4. Once the setup file is downloaded, run it and click on Next.
![RStudio Setup](/images/R/R-studio-install.png "RStudio Setup")
5. Click on Install and proceed for extracting files and installing RStudio.
![RStudio Installing](/images/R/R-studio-installing.png "RStudio Installing")
6. Click on Finish at last.
![RStudio Installed](/images/R/R-studio-installed.png "RStudio Installed")
7. Open RStudio from the installed location or lookup in Start Screen.
![RStudio Welcome Screen](/images/R/R-studio-welcome-screen.png "RStudio Welcome Screen")
8. Now as a demonstration, a sample query has been written in the R script (`File` -> `New File` -> `R Script`). The result will appear in the console section below.
![RStudio Hello World](/images/R/R-studio-hello-world.png "RStudio Hello World")

## Installing R in Ubuntu 20.04/19.04/18.04/16.04
1. Let's first update the packages
```bash
sudo apt update
sudo apt –y upgrade
```
2. Once that's done, install **r-base**
```bash
sudo apt –y install r-base
```
41 changes: 41 additions & 0 deletions content/R/introduction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
date: 2020-08-22
linktitle: Introduction
menu:
main:
parent: R
next: /r/install-env-setup
title: Introduction
weight: 1
url: /r/introduction
description: A gentle introduction to R programming language.
keywords:
- R
tags: [R]
---
## What is R?
R is a programming language that is gaining its importance in software development, machine learning and data science. R is free and open source software under GNU General public license and pre-compiled binary versions and libraries are also provided for various operating systems like MAC, Linux and Windows. R provides a software environment for Statistical Modeling of data, Exploratory Data Analysis, Graphics Representation and Reproducible Researches.

## Evolution of R
R is considered to be the dialect of S language. S language was founded in 1976 by John Chambers and later on at Bell Laboratories as an Internal Statistical Analysis Environment with its implementation of Fortran Libraries. Earlier versions of the language failed in containing various useful functions for Statistical Modeling which led to the development of R language. R Language was founded in 1991 by Ross Ihaka and Robert Gentleman at the University of Auckland, New Zealand, and is currently developed by R Development Core Team.

## Features of R

1. R is a well developed, simple and most interactive programming language which includes conditional and looping statements, user defined functions and libraries.
2. R contains a variety of atomic data types like Numeric, Characters, Logical, Integer and Complex and thereby providing integrated and coherent collection of tools for data analysis.
3. R provides a suite of operators for manipulations of array, data frames, vectors, matrices, strings and lists.
4. Functionality is divided into various modular packages available in R.
5. Graphics capabilities are more sophisticated and contain more Stat Packages for Base plotting system, Lattice systems and ggplots systems.
6. R has its very largely active and vibrant user community.

## Overview of its applications
R has its majority of applications in the field of data science and machine learning algorithms. Some of its applications include:

- Descriptive Analysis
- Exploratory Data Analysis
- Statistical Inferences
- Predictive Modeling
- Causal and Random Analysis
- Mechanistic Analysis and Reproducible Research

As a conclusion, R is proving to be world’s most widely used Statistical Programming Language. It is always the first choice of Data Scientists and also deployed in various critical Business Applications.
38 changes: 38 additions & 0 deletions content/R/standard-deviation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
date: 2020-09-02
linktitle: Standard Deviation
menu:
main:
parent: R
next: /r/standard-deviation
title: Calculating Standard Deviation in R
weight: 27
url: /r/standard-deviation
description: In this section we'll look at how to calculate **Standard Deviation in R**.
keywords:
- R
tags: [R]
---
In this section we'll look at how to calculate **Standard Deviation in R**.

It is a measure of spread of statistical data from its mean or average value. It determines how the data is deviated from its central value. In mathematical terms, it is simply defined as the square root of the variance and is denoted by `σ`.

![Standard Deviation in R](/images/R/R-standard-dev.png?width=10pc "Standard Deviation")

- The smallest value of the standard deviation is zero since it cannot be negative.
- When the data values are very close to each other, then standard deviation is considered to be very low or zero. Similarly when the data values are apart, the standard deviation is high or far from zero.

Let's take the same example that we used in last section to calculate [variance](/r/variance)

- Dataset = `3, 5, 7, 9, 11, 13, 15`.
- Mean = `(3 + 5 + 7 + 9 + 11 + 13 + 15 ) / 7 = 9`
- Squares of deviation = `(3-9)^2 = 36, (5-9)^2 = 16, (7-9)^2 = 4, (9-9)^2 = 0, (11-9)^2 = 4, (13-9)^2 = 16, (15-9)^2 = 36`
- Variance = `(36 + 16 + 4 + 0 + 4 + 16 + 36 ) / 7 = 16`
- Standard Deviation = σ = square root of 16 = 4

R provides an in-built function `sd()` to compute the standard deviation of all the data in the dataset from the central point. The function takes numeric or integer vector as an argument and returns the standard deviation value.

![Standard Deviation in R](/images/R/R-sd.png "sd")

- `x` is a variable that takes the integer vectors using `c()` function
- The result of `sd(x)` is displayed using `print`
Loading