library(fishmove)
reptest.fishmove <- function(a,b){#
	a<-a # number of repeats of repeats (n for boxplot per group)#
	b<-b #vector of number of repeats#
	c <- rep(b,rep(a,length(b)))#
	# Process calculates mean of sigma_stat and sigma_mob for different sets of repeats and writes results into ar#
	ar <- array(NA, dim = c(length(c), 3))#
	for (i in 1:length(c)) {#
		f <- fishmove(species="Salmo trutta fario",rep=c[i])#
		ar[i,] <- cbind(f$pred.fishmove,c[i])["fit",]#
	}#
	# plotting results to see variation in the mean (should get lesser with increasing number of repeats)#
	boxstat <- boxplot(ar[,1]~ar[,3],main="Number of fishmove repeats for stat", #
			xlab="Number of repeats", ylab="mean of sigma_sat")#
	boxmob <- boxplot(ar[,2]~ar[,3],main="Number of fishmove repeats for mob", #
			xlab="Number of repeats", ylab="mean of sigma_mob")#
	par(mfrow=c(2,1))#
	boxstat#
	boxmob	#
}
reptest.fishmove(a=25,b=c(5,10,25,50,75,100,200,250,500,1000))
reptest.fishmove(a=25,b=c(5,10,25,50,75,100,200,250,500,1000))
reptest.fishmove(a=25,b=c(5,10,25,50,75,100,200,250,500,1000))
reptest.fishmove(a=25,b=c(5,10,25,50,75,100,200,250,500,1000))
a=25
b=c(5,10,25,50,75,100,200,250,500,1000)
c <- rep(b,rep(a,length(b)))
c
ar <- array(NA, dim = c(length(c), 3))
ar
a=2
c <- rep(b,rep(a,length(b)))
ar <- array(NA, dim = c(length(c), 3))
ar
for (i in 1:length(c)) {#
		f <- fishmove(species="Salmo trutta fario",rep=c[i])#
		ar[i,] <- cbind(f$pred.fishmove,c[i])["fit",]#
	}
length(c)
f <- fishmove(species="Salmo trutta fario",rep=c[2]
)
f
ar
ar[2,] <- cbind(f$pred.fishmove,c[2])["fit",]
ar[2,] <- cbind(f$pred.fishmove,c[2])["fit",]
f$pred.fishmove
ar
c
ar(3,)
ar[3,]
ar[,3]
ar <- array(Stat=NA,Mob=NA,replicates=c)
ar <- array(Stat,Mob,replicates=c)
array(A=c(1,3),B=c(2,3))
ar <- array(NA, dim = c(length(c), 3),dimnames = c("stat","mob","replicates"))
ar
ar
ar <- array(NA, dim = c(length(c), 3),dimnames = c("stat","mob","replicates"))
ar
array()
ar <- array(NA, dim = c(length(c), 3), dimnames=c("stat","mob","replicates"))
array
?array
ar <- array(NA, dim = c(length(c), 3), dimnames=list("stat","mob","replicates"))
ar <- array(NA, dim = c(length(c), 3), dimnames=list("stat","mob","replicates"))
ar <- array(NA, dim = c(length(c), 3),dimnames=list(NA,c("stat","mob","replicates"))
)
ar <- array(NA, dim = c(length(c), 3),dimnames=list(NA,c("stat","mob","replicates")))
ar <- array(NA, dim = c(length(c), 3))
ar
f <- fishmove(species="Salmo trutta fario",rep=c[2])
f
(f$pred.fishmove)["fit",]
(f$pred.fishmove)["fit"]
(f$pred.fishmove)["fit",]
(f$pred.fishmove)
class((f$pred.fishmove))
(f$pred.fishmove)["fit",,,,]
(f$pred.fishmove)["fit",,,,,]
for (i in 1:length(c)) {#
		f <- fishmove(species="Salmo trutta fario",rep=c[i])#
		ar[i,] <- cbind(f$pred.fishmove,c[i])["fit", , , , ]#
	}
ar <- array(NA, dim = c(length(c), 3))#
	for (i in 1:length(c)) {#
		f <- fishmove(species="Salmo trutta fario",rep=c[i])#
		ar[i,1:2] <- f$pred.fishmove["fit", , , , ]#
		ar[i,3] <- c[i]#
	}
f$pred.fishmove
f$pred.fishmove["fit", , , , ]
f$pred.fishmove["fit", , , , ,]
ar <- array(NA, dim = c(length(c), 3))#
	for (i in 1:length(c)) {#
		f <- fishmove(species="Salmo trutta fario",rep=c[i])#
		ar[i,1:2] <- f$pred.fishmove["fit", , , , ,]#
		ar[i,3] <- c[i]#
	}
reptest.fishmove <- function(a,b){#
	a<-a # number of repeats of repeats (n for boxplot per group)#
	b<-b #vector of number of repeats#
	c <- rep(b,rep(a,length(b)))#
	# Process calculates mean of sigma_stat and sigma_mob for different sets of repeats and writes results into ar#
	ar <- array(NA, dim = c(length(c), 3))#
	for (i in 1:length(c)) {#
		f <- fishmove(species="Salmo trutta fario",rep=c[i])#
		ar[i,1:2] <- f$pred.fishmove["fit", , , , ,]#
		ar[i,3] <- c[i]#
	}#
	# plotting results to see variation in the mean (should get lesser with increasing number of repeats)#
	boxstat <- boxplot(ar[,1]~ar[,3],main="Number of fishmove repeats for stat", #
			xlab="Number of repeats", ylab="mean of sigma_sat")#
	boxmob <- boxplot(ar[,2]~ar[,3],main="Number of fishmove repeats for mob", #
			xlab="Number of repeats", ylab="mean of sigma_mob")#
	par(mfrow=c(2,1))#
	boxstat#
	boxmob	#
}
reptest.fishmove(a=10,b=c(10,50,100,500))
par(mfrow=c(2,1))
boxstat
boxstat <- boxplot(ar[,1]~ar[,3],main="Number of fishmove repeats for stat", #
			xlab="Number of repeats", ylab="mean of sigma_sat")
boxmob <- boxplot(ar[,2]~ar[,3],main="Number of fishmove repeats for mob", #
			xlab="Number of repeats", ylab="mean of sigma_mob")
par(mfrow=c(2,1))#
	boxstat#
	boxmob
boxstat
