Open pomasta opened 4 years ago
Have you tried running with the example input file? What happens when you use this one?
When I run the sample one it does work, I get the following as an output :
The estimated occupancy (psi) is 0.7. The 95% confidence interval for occupancy is 0.376 - 0.9.
The estimated detection probability (p) is 0.476 with a confidence interval of 0.372 - 0.582.
So after cleaning the data file up some more into a format similar to yours using the following code it was able to run. I think the issue came with spacing in the .txt file an having quotes on the column names, and possibly by having the days listed as numbers instead of as day1, etc.
#add 'day' to the observation date
apr_new$total_days <- paste("day", apr_new$total_days, sep = "")
#tidy and pivot wider to allow for compatability based on model input data
apr_form <- apr_new %>%
dplyr::select(c("station_id","number_individuals","total_days")) %>%
pivot_wider(names_from = total_days, values_from = number_individuals) %>%
rename(Camera = "station_id")
#replace NAs with 0
apr_form[is.na(apr_form)] <- 0
#Save cleaned data frame as a .txt for the shiny app
write.table(apr_form,
sep ="\t",
here("cleaned_data","2014_apr_check_RP.txt"),
row.names = FALSE,
quote = FALSE)
When run it gives an output of:
The estimated occupancy (psi) is 1. The 95% confidence interval for occupancy is 0 - 1.
The estimated detection probability (p) is 0.111 with a confidence interval of 0.092 - 0.133.
I am encountering this error message when I try to run the app.
Error in :: argument of length 0 103: [.data.frame 101: occMod 100: renderPrint [E:\Coding\R-4.0.2\library\rapidPop\shiny-apps\occMod/server.R#66] 99: func 83: origRenderFunc 82: output$print 2: shiny::runApp 1: rapidPop::runShiny
Code below
============================
Import Data
Run Shiny App associated with RapidPop
This is the data frame that I am running through the application 2014_apr_check_RP.txt
I have tried running this as a .csv and with out modifying the dates as both a .txt and .csv file but keep getting the same error message. Have tried taking the data from my desktop thinking it was an issue with file path length, but that didn't solve it either.
Any thoughts or help is greatly appreciated.