tidyomics / plyranges

A grammar of genomic data transformation
https://tidyomics.github.io/plyranges/
140 stars 18 forks source link

add_nearest_distance not working #93

Closed u2058152 closed 3 years ago

u2058152 commented 3 years ago

I installed plyranges and carried out the library command. I get an error saying add_nearest_distance command is not found.

Command executed:

peaks_annotated <- genes %>%

  • add_nearest_distance(peaks) %>%
  • join_overlap_inner(peaks, maxgap = 3000)

Error found: Error in add_nearest_distance(., peaks) : could not find function "add_nearest_distance"

snystrom commented 3 years ago

Hey, I can't reproduce this on my end. Would you mind trying a couple things?

u2058152 commented 3 years ago

I installed a newer version of R (I was using R 4.0.2) and add_nearest_distance now works. However, when I try to knit an r markdown file I get the following error message:

Screenshot 2021-10-29 at 13 06 16
snystrom commented 3 years ago

This sounds like a namespacing issue. In the Rmd you're calling library(plyranges) right? If you switch your call to plyranges::add_nearest_distance does that fix it?

u2058152 commented 3 years ago

Thanks for your help this resolves the problem.