[R] Triple Integration in R

2012-12-17 Thread KoopaTrooper
I'm using Kernel Utilization distributions to estimate overlap in animal territories. There are various ways to calculate this overlap and one of the equations is : V.I. = ∫∫∫ min (f1 (x,y,z), f2 (x,y,z)) dxdy where f1 = utilization distribution for bird 1 in 3 spatial dimensions (x,y,z). I can p

[R] Resampling Help Needed

2012-12-03 Thread KoopaTrooper
I am using package ks() to build 3D representations of bird territories and calculate territory volume from spatial data (simply x, y, and z coordinates). What I want to do is determine at what sample size (# locations collected) does the territory volume stop increasing. This should give me an ide

[R] Repeating a series of commands

2012-10-11 Thread KoopaTrooper
I'm trying to figure out how to repeat a series of commands in R and have the outputs added to a dataframe after each iteration. My code starts this way... a<-read.csv("File1.csv") b<-read.csv("File2.csv") a$Z<-ifelse(a$Z=="L",sample(1:4,length(a$Z),replace=TRUE),ifelse(a$Z=="M",sample(5:8,lengt

[R] Converting factors to bounded random numerical data

2012-10-10 Thread KoopaTrooper
I have a data set (a) with three columns (X,Y,Z). The first 2 columns are numeric. The third (Z) is a factor with three levels A,B,C. I want to turn each A into a different random number between 1 and 4, each B into a different random number between 5 and 8, etc. I tried this: a$Z<-ifelse(a$Z=="L

[R] Converting factors to bounded random numerical data

2012-10-10 Thread KoopaTrooper
I have a data set (a) with 3 columns (X,Y,Z). The first 2 columns are numerical. The third column (Z) is a factor with three levels ("A","B","C"). What I want to do is turn each of the "A's" into different random numbers between 1 and 4, "B's" into a random number between 5 and 8, etc. I tried thi