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

Suggestion: Option to not "closeAllConnections()" #1

Closed
GPawi opened this issue Apr 13, 2021 · 3 comments
Closed

Suggestion: Option to not "closeAllConnections()" #1

GPawi opened this issue Apr 13, 2021 · 3 comments

Comments

@GPawi
Copy link

GPawi commented Apr 13, 2021

Dear Maarten,

I recently ran your package in a jupyter notebook with R kernel. My code was fairly simple with this dataset (PG1972.txt - had to convert the .csv to .txt to upload it to this issue):

setwd('D:/HEIBRiDS/Data/clam_runs')
library('clam')
clam(core='PG1972', coredir= 'D:/HEIBRiDS/Data/clam_runs', type = 1, its = 10000)

But it produced an error:

The run's files will be put in this folder: D:\HEIBRiDS\Data\clam_runs/PG1972

 Calibrating dates...  extrapolating beyond dated levels, dangerous!
  Interpolating, sampling.....

Error in isOpen(con):  invalid connection

I think this has to do with the following line:

clam/R/clam.R

Line 412 in 0851eab

closeAllConnections()

I tested my theory by using the trace('clam', edit = TRUE) command and comment line 412 out. Now, I was able to receive an output: Screenshot 2021-04-13 171414.pdf

Would it be possible for you to implement an option to make the statement "closeAllConnections()" optional? It would be helpful for users, who don't use RStudio, as this seems to interfere with the connection from the kernel and the clam package.

All the best,
Gregor

P.S. here's my sessionInfo() for reproducibility:

R version 4.0.4 (2021-02-15)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042)

Matrix products: default

locale:
[1] LC_COLLATE=German_Germany.1252  LC_CTYPE=German_Germany.1252   
[3] LC_MONETARY=German_Germany.1252 LC_NUMERIC=C                   
[5] LC_TIME=German_Germany.1252    

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

other attached packages:
[1] clam_2.3.7

loaded via a namespace (and not attached):
 [1] fansi_0.4.2     digest_0.6.27   utf8_1.2.1      crayon_1.4.1   
 [5] IRdisplay_0.7.0 repr_1.1.0      lifecycle_1.0.0 jsonlite_1.7.2 
 [9] evaluate_0.14   pillar_1.5.1    rlang_0.4.10    uuid_0.1-4     
[13] IntCal_0.1.3    ellipsis_0.3.1  IRkernel_1.1.1  tools_4.0.4    
[17] compiler_4.0.4  base64enc_0.1-3 pbdZMQ_0.3-3.1  htmltools_0.5.0
@Maarten14C
Copy link
Owner

Maarten14C commented Apr 14, 2021 via email

@Maarten14C
Copy link
Owner

Gregor,

I've updated the code - does it work as expected now?

Cheers,

Maarten

@GPawi
Copy link
Author

GPawi commented Apr 14, 2021

Hi Maarten,

Thank you so much for the swift answer and quick fix!
Yes, now everything works as expected. I tested it with both jupyter notebook and RStudio.

Cheers,
Gregor

@GPawi GPawi closed this as completed Apr 14, 2021
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