Skip to content
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 Periodogram Table Function #11

Closed
voza1 opened this issue Apr 13, 2020 · 2 comments
Closed

Error in Periodogram Table Function #11

voza1 opened this issue Apr 13, 2020 · 2 comments

Comments

@voza1
Copy link

voza1 commented Apr 13, 2020

The periodogram function gives me the following error:

Error in [.data.table(regular_data, , .(n_val = length(unique(var__))), :
by=c(...), key(...) or names(...) must evaluate to 'character'
In addition: Warning message:
In regularize.values(x, y, ties, missing(ties)) :
collapsing to unique 'x' values

My var of interest is already type "char" so not sure what the issue is, There is also a unique timestamp for all individuals("Well ID")

github_zeitgebr_issue.zip

@qgeissmann
Copy link
Contributor

Hey @voza1, thank you very much for reporting your issue!
So I have filed it as a bug on ggetho rethomics/ggetho#32. Until I fix it in the package, you can patch things by naming the id column id:

from your code:

####Setting keys####
DATA <- as.data.table(DATA)
setkeyv(DATA, "Well_ID")
setnames(DATA,"Well_ID", 'id' )
METADATA <- as.data.table(METADATA)
setkeyv(METADATA, "Well_ID")
setnames(METADATA,"Well_ID", 'id' )

Then,

per_xsq_test <- periodogram(MAXFLOW, behvr)
ggperio(per_xsq_test, aes(y=power- signif_threshold)) + stat_pop_etho()

Good luck!
leaving the issue open until proper fix
Q

@voza1
Copy link
Author

voza1 commented Apr 20, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants