Академический Документы
Профессиональный Документы
Культура Документы
rm(d, i)
ls()
# If you want to remove all the objects from the workspace, you can do it
by pressing "Clear all" button in the north-east panel of RStudio by typing
the following command:
rm( list = ls(all = TRUE) )
# Workspace can be saved as a file and then loaded:
a <- ( 4 + 3 ) ^ 2 # Reads: a gets the value ( 4 + 3 ) ^ 2
b <- 4 + 3 ^ 2
MyVar <- 2 ^ (3 ^ 2)
save.image("~/Desktop/MyWorkspace.RData")
rm(list = ls(all = TRUE))
load("~/Desktop/MyWorkspace.RData")
##
##
##
##
c(
NUMERIC VECTORS
Single calues can be combined into larger structures
The simples such structure is a numeric vector
Combine individual numbers into a vector using the function c()
1, 2, 3, 4, 5 )
# 1. Go to website http://awp.diaart.org/km/surveyresults.html
# 2. Find results concerning the preferred type of art in Iceland
# 3. Use the percentages reported on that website to create a numeric
vector called art and name each element of that vector accordingly
# 4. Find information on the number of participants in the survey. Use this
information to change the percentages into frequencies
# 5. Check that the frequencies sum to 1,000
# 6. How many subjects would be in the most preferred category if the
sample size were 500?
# 7. Create a pie chart showing art preferences in Iceland. Add a title
# 8. Create a barplot. Color each bar differently. Add a title