Between last night (8/8/25) and this afternoon (8/9/25) RStudio began throwing the following plot.window(. . .) error: ' invalid value specified for graphical parameter "xaxs" '. The error appears using the "calibrate" function from the rcarbon library. This error only appears running the script using the RStudio IDE.
In R, run from a terminal console, it executes as expected.
Checking the parameter using par() in the console and in the IDE workspace finds the parameter set to the default value in both cases.
The code being run:
Set up
rm(list = ls())
opar <- par(no.readonly = T)
setwd(""~/Documents/Projects/****")
options(digits = 3)
Load packages
library(readODS) # Reads Libreoffice ODS files
library(DescTools) # Excellent summary tool including some that plot
library(rcarbon) #Radiocarbon dating and analyis routines. Enrico Crema, Andrew Bevan 2023-08-24
library(rice) #Additional radiocarbon package
library(dplyr)
library(tibble)
library(tidyr)
library(Bchron)
Read data - revert to delimited text.
c14 = read_ods("/home/****/Data/Restructured.ods")
Analysis
cadates=with(c14, calibrate(x=COA, errors=COASD, calCurves='intcal20'))
cadates.spd = spd(cadates,timeRange=c(30000,5000)) # Calculates summed probability
# distributions
plot(cadates.spd)
plot(cadates.spd,runm=200,add=TRUE,type="simple",col="darkorange",lwd=1.5,lty=2)
plot(cadates,2)
multiplot(cadates, decreasing=TRUE, rescale=TRUE, HPD=TRUE, label.pos=0.9, label.offset=-800)
summary(cadates)