Importing data into marked
Posted:
Fri May 10, 2019 3:00 pm
by DNicholson
I am unable to get my data set into marked. The example data set in laake et al 2013 (dippers) runs through everything I need fine. But my own data set (ch string with 14 events, and some numeric morphological variables) wont even go through the process steps.
I followed some example script online with a small made up data set (ch string, sex as a factor, weight as numeric) and I also can't get this to run correctly, see script below:
ExampleData=read.table("example.txt", header=T, colClasses = c("character","factor","numeric"))
ExampleDataProc=process.data(ExampleData, model = "CJS")
I will go into more detail about the associated errors after, but at the moment I just want to know if this is the correct way to import data into marked.
I have used the str() function on dippers and my example and they appear exactly the same, so there must be something I have done that is causing this issue.
Thanks!
Re: Importing data into marked
Posted:
Fri May 10, 2019 9:13 pm
by jlaake
There is no one way to get your data into R to use marked. The only requirement is for data to be a dataframe with a field named ch that is type character. Not sure what problem you are encountering
Re: Importing data into marked
Posted:
Thu May 16, 2019 12:12 pm
by DNicholson
I am using a dataframe with a field called ch that is a character string
structure is below:
> str(ASurvival)
'data.frame': 69 obs. of 7 variables:
$ ch : chr "00000001000100" "00000000000000" "10000000000000" "00000000000000" ...
$ Mass: num 1.48 1.44 0.56 0.99 1.63 1.31 0.97 1.68 1.65 1.69 ...
$ SVL : num 40.6 41.8 29.8 38.6 41.2 ...
$ HLL : num 23.6 23.1 15.8 22.5 22.1 ...
$ FLL : num 14 13.33 9.23 11.18 11.23 ...
$ HD : num 4.77 5.32 3.22 4.63 5.15 4.78 4.79 5.26 5.37 4.8 ...
$ TP : num 1.347 2.506 0.977 1.673 1.907 ...
when I try to use this data frame with process.data() or process.data (dataframe, model ="CJS")
I get the following:
There were 50 or more warnings (use warnings() to see the first 50)
warnings()
1: In FUN(newX[, i], ...) : no non-missing arguments to min; returning Inf
2: In FUN(newX[, i], ...) : no non-missing arguments to min; returning Inf
3: In FUN(newX[, i], ...) : no non-missing arguments to min; returning Inf
4: In FUN(newX[, i], ...) : no non-missing arguments to min; returning Inf
5: In FUN(newX[, i], ...) : no non-missing arguments to min; returning Inf
6: In FUN(newX[, i], ...) : no non-missing arguments to min; returning Inf
7: In FUN(newX[, i], ...) : no non-missing arguments to min; returning Inf
8: In FUN(newX[, i], ...) : no non-missing arguments to min; returning Inf
9: In FUN(newX[, i], ...) : no non-missing arguments to min; returning Inf
10: In FUN(newX[, i], ...) : no non-missing arguments to min; returning Inf
11: In FUN(newX[, i], ...) : no non-missing arguments to min; returning Inf
and so on.
-----------------------------------------------------------------------------------------------------
if I then try to run crm() I get the following:
>CRM1= crm(ASurvival)
Model: CJS
Processing data...
68 capture histories collapsed into 68
Creating design data...
Fitting model
Computing initial parameter estimates
Starting optimization for 2 parameters...
Error in optimx.check(par, optcfg$ufn, optcfg$ugr, optcfg$uhess, lower, :
Cannot evaluate function at initial parameters
In addition: There were 50 or more warnings (use warnings() to see the first 50)
warnings()
1: In FUN(newX[, i], ...) : no non-missing arguments to min; returning Inf
2: In FUN(newX[, i], ...) : no non-missing arguments to min; returning Inf
3: In FUN(newX[, i], ...) : no non-missing arguments to min; returning Inf
4: In FUN(newX[, i], ...) : no non-missing arguments to min; returning Inf
......
48: In FUN(newX[, i], ...) : no non-missing arguments to max; returning -Inf
49: In FUN(newX[, i], ...) : no non-missing arguments to max; returning -Inf
50: In FUN(newX[, i], ...) : no non-missing arguments to max; returning -Inf
-------------------------------------------------------------------------------------------------
Then my object CRM1 is not created.
I have compared the dipper data frame and my own data frame and I cannot understand why one does work and one doesn't.
Thanks!
Re: Importing data into marked
Posted:
Thu May 16, 2019 12:19 pm
by jlaake
Please send the text data file to me at
jefflaake@gmail.com and I'll diagnose problem.