Computational Concept Map
Plotting and Visualizing
plot()
generic plotting
qplot()
quick plotting
ggplot()
create plot and add layers
barplot()
creates barplots
abline()
adds a line to a plot
aes()
adds aesthetic to plot
geom_point()
used to create scatterplots
geom_boxplot
create boxplots
geom_smooth()
helps see patterns
labs()
creates plot labels
ggtitle()
adds a title to a plot
heatmap()
creates a heatmap
Manipulate Data
group_by()
turns existing table into a grouped table
select()
select columns and specify order and what's included
arrange()
reorder or order rows by a specific column
pivot_longer()
increase rows and decrease columns
mutate()
create new columns and add them
summarize()
see a summary of data in a specific column
rbind()
combine by columns or rows
cbind()
combine columns or rows
Sapply()
same as lapply but returns a vector or matrix
tapply()
applies other functions across groups
vapply()
Similar to sapply but allows argument for specific returns
lapply()
return list of same length as original input
as_tibble()
transforms object into a tibble
rep()
replicates values
filter()
subset and filter rows
Return Numeric Values and Info of Data
fivenum()
returns minimum, lower-hinge, median, upper-hinge, maximum
median()
sample median
mean()
gives mean
length()
shows length of vectors
cor.test()
tests for corellation
t.test()
one and two sample t-tests
Operators and Some Arithmetic Functions
Arithmetic
sample()
generate random number
abs()
absolute value function
sqrt()
sqaure root function
%/%
Divide first vector from second quotient
%%
Remainder
^
Rasie to an exponent
*
multiply
-
subtract
+
adds
/
divide
Relational
>
Shows greater than
<
Shows less than
==
Shows if elements are equal
<=
Shows less than or equal
>=
Shows greater than or equal
!=
Shows if something is unequal
Logical
&
Says true if elements are both true
!
Opposite logical value
|
Gives true if one element is true
&&
Says true if both elements are true
||
Gives true if one element is true
Assignment
Assign Values
Left Assignment
<−
<<−
=
Right Assignment
->
->>
Miscellaneous
%in%
Shows if element is in a vector
:
Series of numbers
%*%
Multiply matrix with transpose
Data info
library()
load and add packages
unique()
shows unique elements
dim()
shows dimensions
head()
view first or last parts of something
Create Things
data.frame()
colnames()
set row or column names
creates a data frame
Subtopic
seq()
creates sequences
table()
creates a table
Formatting Text
**x**
Bold
*x*
Italicize
###
##
#
Title sizes
*x
Bullet point
*x
+y
Nested List
> x
Block quote