In [1]:
bubba <- c(3,5,7,9)
In [2]:
bubba[2]
In [4]:
heisenberg <- read.csv(file="/home/lindsayad/Downloads/simple.csv", head=TRUE, sep=",")
In [5]:
heisenberg
In [6]:
summary(heisenberg)
In [7]:
heisenberg$trial
In [9]:
tree <- read.csv(file="/home/lindsayad/Downloads/trees91.csv", header=TRUE, sep=",")
In [10]:
tree
In [11]:
attributes(tree)
In [12]:
a = 3
b = sqrt(a*a+3)
In [13]:
b
In [14]:
b*b
In [15]:
ls()
In [16]:
a = c(1,2,3,4,5)
mean(a)
In [17]:
typeof(a)
In [18]:
summary(tree$CHBR)
In [19]:
levels(tree$CHBR)
In [20]:
tree$C = factor(tree$C)
In [21]:
levels(tree$C)
In [22]:
summary(tree$C)
In [24]:
help(Distributions)
In [27]:
x = seq(-3,3,by=.05)
y = dnorm(x)
In [28]:
plot(x,y)
In [29]:
x = 0.1
if (x < 0.2)
{
x = x + 1
cat("increment that number!")
}
In [30]:
x
In [6]:
tree <- read.csv(file="/home/lindsayad/Downloads/trees91.csv", header=TRUE, sep=",")
In [7]:
plot(tree$STBM,tree$LFBM)
In [8]:
cor(tree$STBM,tree$LFBM)
In [2]:
colt = read.csv(file="robyn-colt-data.csv",head=TRUE,sep=",")
In [3]:
plot(colt$Puberty,colt$BF)
In [4]:
plot(colt$Puberty,colt$TV)
In [5]:
plot(colt$Weight,colt$TV)
In [11]:
with(colt[colt$Horse == "Alta1",], plot(colt$Weight, colt$TV))
In [15]:
help(colt$Horse)
In [13]:
plot(colt$Weight[colt$Horse == "Alta1"], colt$TV[colt$Horse == "Alta1"])
plot(colt$Weight[colt$Horse == "Alta10"], colt$TV[colt$Horse == "Alta10"])
In [22]:
horses = levels(colt$Horse)
In [21]:
typeof(levels(colt$Horse))
In [24]:
horses[1]
In [64]:
foo = "hello"
grepl("hel",foo)
In [68]:
colt = read.csv(file="robyn-colt-data.csv",head=TRUE,sep=",")
horses = levels(colt$Horse)
for (horse in horses) {
if (grepl("Alta", horse)) {
cat(horse, ": ", cor(as.numeric(colt$Weight[colt$Horse == horse]), as.numeric(colt$TV[colt$Horse == horse]), use="pairwise.complete.obs"), "\n")
}
}
In [67]:
colt = read.csv(file="robyn-colt-data.csv",head=TRUE,sep=",")
horses = levels(colt$Horse)
for (horse in horses) {
if (grepl("Alta", horse)) {
plot(colt$Weight[colt$Horse == horse], colt$TV[colt$Horse == horse])
cat(cor(as.numeric(colt$Weight[colt$Horse == horse]), as.numeric(colt$TV[colt$Horse == horse]), use="pairwise.complete.obs"), "\n")
}
}
In [59]:
cor(as.numeric(colt$Weight[colt$Horse == "Alta1"]), as.numeric(colt$TV[colt$Horse == "Alta1"]), use="pairwise.complete.obs")
In [58]:
colt$Weight[colt$Horse == "Alta1"]
In [57]:
as.numeric(colt$Weight[colt$Horse == "Alta1"])
In [38]:
typeof(colt$Weight[colt$Horse == "Alta1"])
In [40]:
typeof(colt$TV[colt$Horse == "Alta1"])
In [43]:
dummy = colt$TV[colt$Horse == "Alta1"]
In [44]:
typeof(dummy)
In [52]:
class(dummy)
In [53]:
dummy = as.numeric(dummy)
In [54]:
class(dummy)
In [47]:
typeof(dummy[1])
In [51]:
is.numeric(dummy[1])
In [45]:
is.vector(dummy)
In [41]:
typeof(1.2)
In [26]:
rapply(horses,f=print)
In [27]:
mode(horses)
In [28]:
is.vector(horses)
In [ ]: