ISAAKiel / oxcAAR

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

Improve documentation #8

Closed MartinHinz closed 6 years ago

MartinHinz commented 7 years ago

The documentation should be checked in respect to comprehensibility and language. The vignette might also be improved to reflect all the possibilities that this fine package offers. When done from the functional point of view, @ctietze91 might also proofread it again?

ctietze91 commented 7 years ago

Sure I can do that, but I'm going to hold the corrections until my 'check-problem' is fixed.

MartinHinz commented 7 years ago

Perfect, expecting that. As you see above, was planned that way :-)

MartinHinz commented 7 years ago

@ctietze91, now might be a good time to start proof reading, if you like?

ctietze91 commented 6 years ago

okay so I wanted to push my changes for the basic-usage.rmd but my r tellls me that there is a problem in line 24-29, which I didnt touch. Did this occur to anybody else? (im supposed to be up-to-date on the package, according to my r)

nevrome commented 6 years ago

That's not a very useful bugreport ;-)

I guess you got this error when you tried to knit the vignette. Can you try to run the R code in the lines 24-29 and provide the result? Maybe you didn't setup Oxcal correctly. The fastest way to do this is to call oxcAAR::quickSetupOxcal().

ctietze91 commented 6 years ago

Sorry. I know. So here it goes:

This is the error I get when knitting, it is similar to what happens when I try to check.

image

I guess the problem presents itself since I do not have a linux? Since the code searches for a specific path.

nevrome commented 6 years ago

Haha - I don't know how I missed that yesterday. This can't work on Windows. @MartinHinz probably only had Linux in mind when he wrote this.

I would suggest to change the paragraph to something like this:


Lets assume, we want to calibrate a date 5000 BP +- 25 years. oxcAAR has the function oxcalCalibrate for doing so. But at first we have to load the package and setup OxCal (or tell oxcAAR where to find the local path to OxCal). Than you can calibrate the date using bp, std and name.

library(oxcAAR)
quickSetupOxcal()
#setOxcalExecutablePath("~/OxCal/bin/OxCalLinux")
my_date <- oxcalCalibrate(5000,25,"KIA-12345")
my_date
plot(my_date)

Btw. is it "Oxcal" or "OxCal"?

ctietze91 commented 6 years ago

It doesn't work. He wants to set the path and is complaining that he cant. Didn't @quassinja try the wohl thing with her laptop and said it worked? Or am I mixing something up?

nevrome commented 6 years ago

Maybe a user permission problem? Do you get an error message? Could you try to download OxCal manually and call setOxcalExecutablePath("path/to/your/OxCal/bin/OxCalWin.exe")? Maybe it's best to meet with @MartinHinz in person to debug this.

@MoritzMennenga & @quassinja Would you mind testing quickSetupOxcal() on your windows systems?

MoritzMennenga commented 6 years ago

The Quicksetup works fine, but then I got a problem while calibrating (I started RStudio in Adminiistrator mode)

> install_github('ISAAKiel/oxcAAR')
Downloading GitHub repo ISAAKiel/oxcAAR@master
from URL https://api.github.com/repos/ISAAKiel/oxcAAR/zipball/master
Installing oxcAAR
"D:/R/R-3.4.1/bin/x64/R" --no-site-file --no-environ --no-save --no-restore --quiet CMD INSTALL  \
  "C:/Users/mo1005.NIHK/AppData/Local/Temp/RtmpqoCQWz/devtools3a74778e5f71/ISAAKiel-oxcAAR-c1f08f0"  \
  --library="C:/Users/mo1005.NIHK/Documents/R/win-library/3.4" --install-tests 

* installing *source* package 'oxcAAR' ...
** R
** tests
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
*** arch - i386
*** arch - x64
* DONE (oxcAAR)
> library(oxcAAR)
> quickSetupOxcal()
Oxcal doesn't seem to be installed. Downloading it now:
trying URL 'https://c14.arch.ox.ac.uk/OxCalDistribution.zip'
Content type 'application/zip' length 3086046 bytes (2.9 MB)
downloaded 2.9 MB

Oxcal download to C:\Users\mo1005.NIHK\Documents successful!
Oxcal path set!
NULL
> my_date <- oxcalCalibrate(5000,25,"KIA-12345")
OxCal v4.3.2 (c) Bronk Ramsey (2017)
Error in file(file, "r") : cannot open the connection
In addition: Warning message:
In file(file, "r") :
  cannot open file 'C:\Users\MO1005~1.NIH\AppData\Local\Temp\RtmpqoCQWz\file3a742e962756.js': No such file or directory
MoritzMennenga commented 6 years ago

Second try with my libPath (not the standart one)

> library(oxcAAR)
> quickSetupOxcal()
OxCal v4.3.2 (c) Bronk Ramsey (2017)
Oxcal is installed but Oxcal executable path is wrong. Let's have a look...
Oxcal path set!
NULL
> setOxcalExecutablePath("C:\\Users\\mo1005.NIHK\\Documents\\OxCal\\bin\\OxCalWin.exe")
Oxcal path set!
> my_date <- oxcalCalibrate(5000,25,"KIA-12345")
OxCal v4.3.2 (c) Bronk Ramsey (2017)
Error in file(file, "r") : cannot open the connection
In addition: Warning message:
In file(file, "r") :
  cannot open file 'C:\Users\MO1005~1.NIH\AppData\Local\Temp\RtmpqoCQWz\file3a7422026d3f.js': No such file or directory
nevrome commented 6 years ago

Thanks for the nice bug report Moritz. Your error seems to be different from the one @ctietze91 gets. Could you check if C:\Users\MO1005~1.NIH\AppData\Local\Temp\ is a correct path and run the whole thing without administrator permissions?

Maybe there's something fishy going on here https://github.com/ISAAKiel/oxcAAR/blob/c1f08f092778dddabd98abb10711df09616af330/R/executeOxcalScript.R#L15 and we can't see it, because the output is suppressed. Then this https://github.com/ISAAKiel/oxcAAR/blob/c1f08f092778dddabd98abb10711df09616af330/R/oxcalCalibrate.R#L13 throws an error.

I stole my brothers windows 7 laptop and tried to reproduce your errors. Unfortunately it works fine there.

MoritzMennenga commented 6 years ago

@nevrome The path exists. Running it in normal mode causes the same error

> library(oxcAAR)
> quickSetupOxcal()
Oxcal is installed but Oxcal executable path is wrong. Let's have a look...
Oxcal path set!
NULL
> setOxcalExecutablePath("C:\\Users\\mo1005.NIHK\\Documents\\OxCal\\bin\\OxCalWin.exe")
Oxcal path set!
> my_date <- oxcalCalibrate(5000,25,"KIA-12345")
Error in file(file, "r") : cannot open the connection
In addition: Warning message:
In file(file, "r") :
  cannot open file 'C:\Users\MO1005~1.NIH\AppData\Local\Temp\Rtmp0sKvvb\file34682ebe5504.js': No such file or directory
MoritzMennenga commented 6 years ago

I will try it at home o my notebook later on. I made the experience, that sometimes stuff works on one Windows PC, but not on the other.

quassinja commented 6 years ago

I am sorry, just returned back to Kiel yesterday from Cologne. Wil try it with my computer in the evening, but the problem I had that @ctietze91 mentioned was something different and was solved in Berlin.

nevrome commented 6 years ago

@MoritzMennenga

How does the temporary input file with the oxcal code look like after you run oxcalCalibrate(5000,25,"KIA-12345")? It's at the same location as the output file that is mentioned in the error (C:\Users\MO1005~1.NIH\AppData\Local\Temp\Rtmp...\tempfile_name_without_point_js).

It's supposed to contain the following line: R_Date("KIA-12345", 5000, 25);

If this file is available and correctly written, then please try to call oxcal on it. Should work with something like this:

C:\Users\mo1005.NIHK\Documents\OxCal\bin\OxCalWin.exe C:\Users\MO1005~1.NIH\AppData\Local\Temp\Rtmp...\tempfile_name_without_point_js

Does this create tempfile_name_with_point_js (the file mentioned in the error) or do you get an error from OxCal here?

MoritzMennenga commented 6 years ago

Ok, it works fine on my laptop, lets see the differences: destoppc: windows 7, RStudio-Version 1.0.136, R 3.4.1 64 bit laptop: windows 8, RStudio-Version 1.0.153, R 3.4.1 64-bit

> library(oxcAAR)
> quickSetupOxcal()
Oxcal is installed but Oxcal executable path is wrong. Let's have a look...
Oxcal path set!
NULL
> my_date <- oxcalCalibrate(5000,25,"KIA-12345")
OxCal v4.3.2 (c) Bronk Ramsey (2017)
> my_date

    KIA-12345
BP = 5000, std = 25

  one sigma: 3796 BC - 3712 BC
  two sigma: 3931 BC - 3704 BC
three sigma: 3944 BC - 3692 BC

Calibrated after:
      IntCal13 atmospheric curve (Reimer et al 2013) 
> plot(my_date)
ctietze91 commented 6 years ago

Okay so the quick session with Martin worked. Was able to push my changes. Could someone look into my [xxx] in the text?? Maybe @MartinHinz ?

nevrome commented 6 years ago

@ctietze91 What caused the issue and how did you solve it?

ctietze91 commented 6 years ago

So the issue was really with my computer -.- . He didn't like the OxCal download. Only found out after I checked my security log. After I resolved this issue, the resolution with the quicksetup - version by @nevrome worked. Sorry for the mess.

MartinHinz commented 6 years ago

I do not see any [xxx] in the text! Is that correct, @ctietze91? If so, I declare the version 1.0 of oxcAAR open!