federicomarini / flowcatchR

A framework for tracking and analyzing flowing blood cells in time lapse microscopy images
https://federicomarini.github.io/flowcatchR/
BSD 3-Clause "New" or "Revised" License
5 stars 0 forks source link

computeMSD #2

Open gilitho opened 3 years ago

gilitho commented 3 years ago

It seems that the computeMSD function isn´t present in the flowcatchR package version 1.26.0. This is the error I receive when calling it:

Error in computeMSD(x, y, until = 30) : could not find function "computeMSD"

Any ideas? Thanks Gilberto

federicomarini commented 3 years ago

Hi Gilberto,

I just ran

library("flowcatchR")
example("kinematics")

in this setup

> sessionInfo()
R version 4.1.0 (2021-05-18)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Mojave 10.14.6

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.1/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] flowcatchR_1.27.0 EBImage_4.35.0   

loaded via a namespace (and not attached):
 [1] locfit_1.5-9.4      tidyselect_1.1.1    xfun_0.25          
 [4] purrr_0.3.4         lattice_0.20-44     colorspace_2.0-2   
 [7] vctrs_0.3.8         generics_0.1.0      viridisLite_0.4.0  
[10] htmltools_0.5.2     yaml_2.2.1          utf8_1.2.2         
[13] plotly_4.9.4.1      rlang_0.4.11        later_1.3.0        
[16] pillar_1.6.2        glue_1.4.2          DBI_1.1.1          
[19] BiocParallel_1.27.4 BiocGenerics_0.39.2 jpeg_0.1-9         
[22] lifecycle_1.0.0     munsell_0.5.0       gtable_0.3.0       
[25] htmlwidgets_1.5.3   evaluate_0.14       knitr_1.33         
[28] fastmap_1.1.0       httpuv_1.6.2        parallel_4.1.0     
[31] fansi_0.5.0         Rcpp_1.0.7          xtable_1.8-4       
[34] promises_1.2.0.1    scales_1.1.1        jsonlite_1.7.2     
[37] abind_1.4-5         mime_0.11           ggplot2_3.3.5      
[40] png_0.1-7           digest_0.6.27       tiff_0.1-8         
[43] dplyr_1.0.7         shiny_1.6.0         grid_4.1.0         
[46] tools_4.1.0         bitops_1.0-7        magrittr_2.0.1     
[49] lazyeval_0.2.2      RCurl_1.98-1.4      tibble_3.1.4       
[52] tidyr_1.1.3         crayon_1.4.1        pkgconfig_2.0.3    
[55] ellipsis_0.3.2      data.table_1.14.0   httr_1.4.2         
[58] assertthat_0.2.1    rmarkdown_2.10      R6_2.5.1           
[61] fftwtools_0.9-11    colorRamps_2.3      compiler_4.1.0     

... and had no errors. Can you probably try in a fresh instance of R/RStudio, where you load the package at the beginning of the session?

Federico

federicomarini commented 3 years ago

Oh wait- you are calling that explicitly? That function has been kept as internal. If you see any good reason to use it like that in other code snippets of yours, you need to prepend the call to it with ::: and the package name.

So, you'd say

flowcatchR:::computeMSD(x, y, until = 30)

This is not a recommended usage of such functions, but nothing forbids you to use it like this