ISAAKiel / oxcAAR

R Package - Interaction with Oxcal
GNU General Public License v2.0
21 stars 4 forks source link

Allow to select the output directory of executeOxcalScript() (fixes #42) #47

Closed nfrerebeau closed 2 years ago

nfrerebeau commented 2 years ago

This should allow to choose where to write the output files (fixes #42).

my_oxcal_code <- ' Plot()
 {
  Sequence("Sequence1")
  {
   Boundary("Beginn");
   Phase("Phase1")
   {
    R_Date("Lab-1",5000,25);
    R_Date("Lab-2",4900,37);
   };
   Boundary("Between");
   Phase("Phase2")
   {
    R_Date("Lab-3",4800,43);
   };
   Boundary("End");
  };
 };'

# Write files named "results" in the working directory
my_result_file <- executeOxcalScript(my_oxcal_code, file = "results")

# Write files in the "here" directory (will be created if it does not exist) in the user home
my_result_file <- executeOxcalScript(my_oxcal_code, file = "~/here/results")
codecov-commenter commented 2 years ago

Codecov Report

Merging #47 (f16259a) into master (109a20d) will decrease coverage by 0.18%. The diff coverage is 40.00%.

@@            Coverage Diff             @@
##           master      #47      +/-   ##
==========================================
- Coverage   66.22%   66.04%   -0.19%     
==========================================
  Files          13       13              
  Lines         909      913       +4     
==========================================
+ Hits          602      603       +1     
- Misses        307      310       +3     
Impacted Files Coverage Δ
R/executeOxcalScript.R 72.72% <40.00%> (-27.28%) :arrow_down:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

MartinHinz commented 2 years ago

Many thanks for this helpful enhancement! Some tests fail, but that's not because of the new code, so I'll gladly include the pull request in the current development version.