length_normalize <- function(v){#
	# normalize all the values in v by the sum of the#
	# values in the vector#
	sum <- 0#
	#
	for( i in v){#
		sum <- sum + 1#
	}#
	#
	for(i in 1:length(v)){#
		v[i] <- v[i] / sum#
	}#
	#
	return v#
}
length_normalize <- function(v){#
	# normalize all the values in v by the sum of the#
	# values in the vector#
	sum <- 0#
	#
	for( i in v){#
		sum <- sum + 1#
	}#
	#
	for(i in 1:length(v)){#
		v[i] <- v[i] / sum#
	}#
	#
	return(v)#
}
length_normalize(1:10)
sum(1:10)
length_normalize <- function(v){#
	# normalize all the values in v by the sum of the#
	# values in the vector#
	sum <- 0#
	#
	for( i in v){#
		sum <- sum + i#
	}#
	#
	for(i in 1:length(v)){#
		v[i] <- v[i] / sum#
	}#
	#
	return(v)#
}
length_normalize(1:10)
length_normalize <- function(v){#
	return(v/sum(v))#
}
length_normalize(1:10)
1:.5:10
1:10:.5
x = 3555535553253354555555545
x
x = [3555535553253354555555545]
x
x = 1 2 3
x = [1 2 3]
x = (1 2 3)
x = c(1 2 3)
x <- c(1 2 3)
x <- c(1, 2, 3)
x
y <- c(1, 2, 3)
correl(x, y)
cor(x, y)
cor.test(x,y)
x <- c(3,5,5,5,5,3,5,5,5,3,2,5,3,3,5,4,5,5,5,5,5,5,5,4,5)
y <- c(5,5,5,5,5,2,4,4,5,2,5,5,4,4,5,4,3,4,5,5,5,5,5,3,5)
cor.test(x,y)
x <- c(5,5,5,5,5,3,5,2,2,2,5,1,3,3,5,5,5,1,5,5,5,5,3,3,5)
y <- c(5,5,5,5,5,2,2,2,3,1,5,4,5,4,5,5,5,4,5,5,5,5,5,2,5)
cor.test(x,y)
x <- c(1,2,1,1,1,2,3,1,3,1,1,2,2,1,3,2,2,1,2,1,3,4,2,2,1)
y <- c(1,2,1,2,2,2,1,1,2,1,1,3,4,1,2,3,1,3,1,2,3,5,2,3,3)
cor.test(x,y)
x <- c(5,5,5,5,5,5,5,5,5,3,5,5,5,5,5,4,4,5,3,5,5,5,3,5)
y <- c(5,5,5,5,5,5,5,4,5,3,4,5,5,5,5,5,3,5,3,5,5,5,4,5)
x <- c(5,5,5,5,5,5,5,5,5,3,5,5,5,5,5,4,4,5,3,5,5,5,3,5)
cor.test(x,y)
x <- c(5,1,3,5,4,3,5,5,3,3,4,5,4,5,4,4,4,5,1,5,2,3,5,5)
y <- c(5,3,5,5,5,5,5,5,4,3,5,5,4,5,5,5,5,5,1,5,5,5,5,5,5)
cor.test(x,y)
x <- c(5,1,3,5,4,3,5,5,3,3,4,5,4,5,4,4,4,5,1,5,2,3,5,5,3)
cor.test(x,y)
x <- c(1,2,2,1,3,2,1,4,3,2,1,1,4,1,4,3,1,1,2,1,3,3,2,1)
y <- c(1,3,4,3,2,5,1,1,5,5,1,1,5,1,5,1,1,1,3,1,4,5,1,1,1)
cor.test(x,y)
x <- c(1,2,2,1,3,2,1,4,3,2,1,1,4,1,4,3,1,1,2,1,3,3,2,1,3)
cor.test(x,y)
4
4/6
2*15
getwd()
dir()
setwd("classes")
setwd("cs150")
setwd("examples/")
dir()
setwd("R-examples/")
dir()
dir("..")
setwd("..")
dir
dir()
source("simple_function.R")
setwd("R-examples/")
source("simple_function.R")
dave_add(1,2)
open("simple_function.R")
source("/Users/dkauchak/classes/cs150/examples/R-examples/simple_function.R")
mystery1(10)
source("/Users/dkauchak/classes/cs150/examples/R-examples/simple_function.R")
source("/Users/dkauchak/classes/cs150/examples/R-examples/python_vs_r.R")
mystery1(10)
mystery3(10)
mystery3(100)
mystery3(1000)
mystery3(10000)
mystery3(100000)
mystery3(100000)
mystery3(1000000)
x <- 10
x
1:10
1:100
1:100:-1
seq(2, 20, 2)
seq(20, 1, -1)
mystery4("test.txt")
x = c(1, 2, 3)
x
x * x
x^3
x+x
x[1:2]
mystery3b(100000)
mystery3(100000)
mystery3b(1000000)
mystery3(1000000)
source("linear_regression.R")
x = 1:10
x
x < 5
x %% 2
x %% 2 != 0
clear()
