akoyabio / phenoptr

Helper functions for working with inForm data.
https://akoyabio.github.io/phenoptr/
zlib License
13 stars 11 forks source link

Issue with phenoptr: multi-radii spatial analysis error/namespace #5

Closed Athanasios72 closed 5 years ago

Athanasios72 commented 5 years ago

Hi, I installed the newest version of R (3.5.3) and RStudio (1.2.1335). I also installed the latest version of "phenoptr" and run my usual script for multi-radii spatial analysis of my samples (obtained using Inform 2.3):

library(phenoptr) base_path <- '~/OPAL R ANALYSIS/Mac panel/SPATIAL ANALYSIS/MULTI-RADII/IMminGC/' pairs <- list(

  • c('AE1AE3', 'CD68CD163'),
  • c('AE1AE3', 'CD68CD163CD206'),
  • c('AE1AE3', 'CD68CD163CD206IRF8'),
  • c('AE1AE3', 'CD68CD163IRF8')) radius<-c(10, 20, 30 ,40) counts <- count_within_batch(base_path, pairs, radius, verbose=FALSE) Loading required namespace: rtree Failed with error: ‘there is no package called ‘rtree’’

Am I doing something wrong? What can I do to solve this error and run my script? Previously I had been running R v3.3.1 and the same script run perfectly.

Thank you.

gadenbuie commented 5 years ago

rtree is a suggested dependency of phenoptr, meaning that is not installed if you used the default installation via remotes::install_github(). You can either install rtree with

install.packages("rtree")

or you can re-install phenoptr with all dependencies, including those listed in Suggests, with

remotes::install_github("akoyabio/phenoptr", dependencies = TRUE)

You may also need to add force = TRUE if install_github() says that the package hasn't updated since last install.

AB-Kent commented 5 years ago

Despite the scary message, I think your script has run correctly. Can you check if you got the expected results?

Options:

Athanasios72 commented 5 years ago

Thank you @gadenbuie for your suggestion. I did as you suggested (reinstall with all dependencies) and my script run perfectly. Also thank you @AB-Kent. After reinstalling with all dependencies, count_within_batch is much faster.