-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error in names(output) <- *vtmp*
: 'names' attribute [1] must be the same length as the vector [0]
#129
Comments
Did you find any solution? I am having the same issue. Edit: Seems to be a formating problem of the replicate column. |
Hi @pedrosenna -- I am not seeing that error when I run the tests, and there is insufficient information in this ticket to replicate the problem. I suspect it is a problem with your input data not being structured as the function expects, but there is not enough info to tell. If you provide a reprex (reproducible example, see https://stackoverflow.com/a/5963610), it will likely surface the issue right away. |
Hi pedrosenna and the community. @pedrosenna did you manage to find a solution? I am experiencing the same problem. Strangely, I subset my dataset (into sediment and water samples) and the sediment samples work no problem, but the water sample subset returns this error....very strange! R code for reference `library(codyn) #load data #Month Type SampleSite ASV_15 ASV_17 ASV_20 ASV_21 ASV_26 ASV_27 i6s_wide <- i6s_wide %>% i6s_wide<-t(i6s_wide) i6s_long<-i6s_wide %>% i6s_long$Month[i6s_long$Month=="Ja"]<-1 head(i6s_long) str(i6s_long) str(i6s_long) i6s_long_s<-subset(i6s_long, Type == "S") #1 1 S MP1 ASV_15 0 i6s_long_w<-subset(i6s_long, Type == "W") #Sediment #Water Error message: Error in names(output) <- |
I had this problem and appear to have solved it. The error occurs when your replicate variable only has one timestamp/year. By this I mean that your replicate.var must have at least 2 years from which can calculate the turnover. It didn't work for me until I removed replicates (in my case unique sites) that only had one year within which there was an only one observation. |
Glad you figured it out @lagoodal -- those types of issues are common and require tracking them down with the specific dataset you are using. I suspect the other issues in this thread are similar, but the details will vary. Providing a reprex is key to tracking these down, and the process of distilling the problem down to a reprex often reveals the issue directly. |
Hi,
I am currently running into this error using the turnover function.
spTurnover <- turnover(df = turnover_dat, time.var = "year", species.var = "species", abundance.var = "abundance",
replicate.var = "site")
Error in names(output) <-
*vtmp*
:'names' attribute [1] must be the same length as the vector [0]
Link to question below:
https://stackoverflow.com/questions/73142397/error-in-namesoutput-vtmp-names-attribute-1-must-be-the-same-leng
Any help would be greatly appreciated!
The text was updated successfully, but these errors were encountered: