Closed hydroacoustic closed 5 months ago
I noticed that the variables are indexed in EchoView not from 1... but from 0...
I have modified the code:
EVGetVariables <- function(EVFile){
#number of variables in EV FIles
nvar = EVFile[['Variables']]$Count()
#create list of variables
vars = apply(matrix(1:nvar),1,
FUN=function(x){EVFile[['Variables']]$Item(x-1)$Name()})
if(length(vars) > 0){
msgV = paste0(Sys.time(),": Success ", nvar, " variables detected")
}else{
msgV = paste0(Sys.time(),": Error - No variables detected")
}
message(msgV)
return(list(variables=vars,msg=msgV))
}
And now it seems to work. For some reason EchoView did not like EVFile$EVFile
EchoviewR 1.1.20 function EVGetVariables gives error (Echoview 12 and 13):
Error in EVFile$EVFile[["Variables"]] : object of type 'closure' is not subsettable