-
Notifications
You must be signed in to change notification settings - Fork 0
/
terms.qmd
118 lines (84 loc) · 6.43 KB
/
terms.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
---
title: "Glossary"
engine: knitr
---
## Overview
Learning a programming language is just like learning a spoken language: there are a lot of terms and definitions to learn! To complicate matters for an [{{< fa brands r-project >}} R]{.r} / [{{< fa brands python >}} Python]{.py} bilingualism context like this one, the two programming languages sometimes use the same term with very different definitions attached. To hopefully streamline term acquisition / comparison, I'm compiling a glossary of crucial [{{< fa brands r-project >}} R]{.r} and [{{< fa brands python >}} Python]{.py} terms below.
Note that if a definition has a term in both languages, the definition is given with the terms in the respective languages beneath. If a term is only found in one language it is given first and subsequently defined.
## General Terms
- Data stored for later re-use (regardless of structure/dimensions)
- [{{< fa brands python >}} Python]{.py} -- variable
- [{{< fa brands r-project >}} R]{.r} -- object
- Category of information stored in a given data [variable]{.py}/[object]{.r}
- [{{< fa brands python >}} Python]{.py} -- type
- [{{< fa brands r-project >}} R]{.r} -- class
- Downloadable set of functions
- [{{< fa brands python >}} Python]{.py} & [{{< fa brands r-project >}} R]{.r} -- library / package
- See "Tools" for definition of 'function'
## Data [Types]{.py}/[Classes]{.r}
- Numbers that are not a fraction (i.e., are a whole number)
- [{{< fa brands python >}} Python]{.py} & [{{< fa brands r-project >}} R]{.r} -- integer
- [{{< fa brands python >}} Python]{.py} `pandas` library -- int64
- Non-integer numbers
- [{{< fa brands python >}} Python]{.py} -- float
- [{{< fa brands python >}} Python]{.py} `pandas` library -- float64
- [{{< fa brands r-project >}} R]{.r} -- numeric
- Text / content stored as text
- [{{< fa brands python >}} Python]{.py} -- string
- [{{< fa brands python >}} Python]{.py} `pandas` library -- object
- [{{< fa brands r-project >}} R]{.r} -- character
- Categorical content with an order among the unique entries (often--though not necessarily--with few _unique_ entries relative to _total_ number of entries)
- [{{< fa brands r-project >}} R]{.r} _ONLY_ -- factor
- Logical values indicating whether conditions are met
- [{{< fa brands python >}} Python]{.py} -- boolean (`True` / `False`)
- [{{< fa brands r-project >}} R]{.r} -- boolean (`TRUE` / `FALSE` / `T` / `F`)
- [Variable]{.py}/[Object]{.r} holding an ordered sequence of data (_can_ be modified)
- [{{< fa brands python >}} Python]{.py} -- list
- [{{< fa brands r-project >}} R]{.r} -- vector (_must_ be one-dimensional) / list
- Each component of a [list]{.py}/[list]{.r}
- [{{< fa brands python >}} Python]{.py} -- item
- [{{< fa brands r-project >}} R]{.r} -- element
- [Variable]{.py} holding an ordered sequence of data (_cannot_ be modified)
- [{{< fa brands python >}} Python]{.py} _ONLY_ -- tuple [too-pull]
## Operators
- Assignment operator -- creates a new [variable]{.py}/[object]{.r}
- [{{< fa brands python >}} Python]{.py} -- `=`
- [{{< fa brands r-project >}} R]{.r} -- `<-` / `->`
- Arithmetic operators -- performs basic arithmetic
- [{{< fa brands python >}} Python]{.py} & [{{< fa brands r-project >}} R]{.r} -- addition (`+`)
- [{{< fa brands python >}} Python]{.py} & [{{< fa brands r-project >}} R]{.r} -- subtraction (`-`)
- [{{< fa brands python >}} Python]{.py} & [{{< fa brands r-project >}} R]{.r} -- multiplication (`*`)
- [{{< fa brands python >}} Python]{.py} & [{{< fa brands r-project >}} R]{.r} -- division (`/`)
- [{{< fa brands python >}} Python]{.py} -- exponent (`**`)
- [{{< fa brands r-project >}} R]{.r} -- exponent (`^`)
- Arithmetic assignment operator -- does an arithmetic operation and stores the result in a [variable]{.py}
- [{{< fa brands python >}} Python]{.py} _ONLY_ -- arithmetic operator and assignment operator (e.g., `+=`)
- Relational operators -- conditional statements that return boolean values
- [{{< fa brands python >}} Python]{.py} & [{{< fa brands r-project >}} R]{.r} -- 'exactly equal to' (`==`)
- [{{< fa brands python >}} Python]{.py} & [{{< fa brands r-project >}} R]{.r} -- 'not equal to' (`!=`)
- [{{< fa brands python >}} Python]{.py} & [{{< fa brands r-project >}} R]{.r} -- greater/less than (`>` / `<` respectively)
- [{{< fa brands python >}} Python]{.py} & [{{< fa brands r-project >}} R]{.r} -- greater/less than or equal to (`>=` / `<=` respectively)
- Namespacing operator -- specifies library in which a given function is defined
- [{{< fa brands python >}} Python]{.py} -- a period `package.function` _(required)_
- [{{< fa brands r-project >}} R]{.r} -- two colons `package::function` _(optional)_
## Tools
- [variable]{.py}/[object]{.r} containing multiple, inter-related operations that are run in a pre-defined order every time the [variable]{.py}/[object]{.r} is used
- [{{< fa brands python >}} Python]{.py} & [{{< fa brands r-project >}} R]{.r} -- function
- Value sent to a function when called to modify behavior (sometimes optional)
- [{{< fa brands python >}} Python]{.py} & [{{< fa brands r-project >}} R]{.r} -- argument / parameter
- Function that can only be used on a specific [type]{.py}/[class]{.r} of [variable]{.py}/[object]{.r} that supports arguments (sometimes optional) to modify behavior
- [{{< fa brands python >}} Python]{.py} -- method (`variable.method(...)`)
- [{{< fa brands r-project >}} R]{.r} -- just a special case of function
- Function that can only be used on a specific [type]{.py}/[class]{.r} of [variable]{.py}/[object]{.r} _without_ arguments to modify behavior
- [{{< fa brands python >}} Python]{.py} -- attribute (`variable.attribute`)
- [{{< fa brands r-project >}} R]{.r} -- just a special case of function
## Data Characteristics
- Number of [items]{.py}/[elements]{.r} in a [variable]{.py}/[object]{.r}
- [{{< fa brands python >}} Python]{.py} -- length (`len()`)
- [{{< fa brands r-project >}} R]{.r} -- length (`length()`)
- Number of rows/columns in a two-dimension, tabular [variable]{.py}/[object]{.r}
- [{{< fa brands python >}} Python]{.py} -- shape (`.shape`)
- [{{< fa brands r-project >}} R]{.r} -- dimensions (`dim()`)
- Number of characters in a string
- [{{< fa brands python >}} Python]{.py} -- also length (`len()`)
- [{{< fa brands r-project >}} R]{.r} -- number of characters (`nchar()`)