library('psych')
library('lsr')
Fibonacci <- c(1,1,12,3,5,8,13)
plot(Fibonacci)
Melhorando o gráfico…
plot(Fibonacci,
+ main="Titulo",
+ sub="sub-titulo",
+ xlab="n",
+ ylab="fib(n)",
+ font.main=2,
+ col.main='tomato4',
+ cex.main=1.5,
+ font.lab=2)
Dá para ficar melhor
plot(x = Fibonacci,
main = "The first 7 Fibonnaci numbers", # the data to plot
xlab = "Position in the sequence", #x-axis label
ylab = "The Fibonnaci number", #y-axis label
font.main = 1, #plain text for title
cex.main = 1.2, #20% more text expansion for title
font.axis = 2 , #bold text for numbers
col.lab = "gray50", # grey colour for labels
type = 'o'
)
Tente outros tipos:
type = p, o, l, b, h, s, S, c, n
Download do arquivo: driving.Rdata
load("driving.Rdata")
Execute os comandos abaixo para conhecer melhor os dados importados.
library('lsr')
library('car')
who(1)
head(driving)
describe(driving)
summary(driving)
plot(x = driving$age, y= driving$rt_time1)
plot(x = driving$age,
y = driving$rt_time1,
main = "Response Time by Age",
xlab = "Age (years)",
ylab = "Mean Response Time (ms)",
pch = 19,
col = "blue",
font.axis = 2,
col.lab = 'grey40'
)
scatterplot(age ~ rt_time1,
data = driving,
smooth=FALSE,
main = "Response Time by Age",
xlab = "Age (years)",
ylab = "Mean Response Time (ms)"
)
boxplot(
formula = age ~ distractor,
data = driving,
main = "Age by Distractor Factors",
xlab = "Distractor",
ylab = "Age (years)",
names = c('None', 'Radio', 'Toddler')
)
boxplot(
formula = age ~ distractor,
data = driving,
main = "Age by Distractor Factors",
xlab = "Distractor",
ylab = "Age (years)",
names = c('None', 'Radio', 'Toddler'),
frame.plot = FALSE,
border="grey40",
medlty="blank",
medpch=20,
medwd = 1.5,
boxwex=0.5
)
hist(driving$errors_time1)
hist(
x = driving$errors_time1,
breaks = c(0,5,10,15,20),
xlab = "Number of Errors on Test 1",
main = "",
density = 20
)
hist(
x = driving$errors_time1,
breaks = c(0,5,10,15,20),
xlab = "Number of Errors on Test 1",
main = "",
col = "maroon",
border = "white"
)