Description Usage Arguments Value Examples
View source: R/get_agricurb_data.R
1 2 3 |
Keep modern data and as many archaeological datasets as specified in arc_datasets
.
Eliminate rows with unknown Size
in the archaeological datasets.
Eliminate rows with Category
different to wheat
and barley
.
Modify Rainfall
in the archaeological data sets. Creates Rainfall_min=Rainfall+minRainfall
and Rainfall_max=Rainfall+maxRainfall
, and after that Rainfall=NA
.
Transform the variables listed in vars_log
to a logaritmic scale.
Rescale the variables listed in vars_scale_int_0_1
to the interval [0,1]
.
Rescale the variables listed in vars_scale_mean_0_var_1
to have empirical mean 0 and empirical variance 1.
1 2 3 4 5 6 7 | get_agricurb_data(
arc_datasets = "NMeso",
vars_log = NULL,
vars_sqrt = NULL,
vars_scale_int_0_1 = NULL,
vars_scale_mean_0_var_1 = NULL
)
|
arc_datasets |
indicated the datasets used for sampling the archaeological covariates. |
vars_log |
indicated the variables to be rescale to have mean |
vars_sqrt |
indicated the variables that are transformed with square root. |
vars_scale_int_0_1 |
indicated the variables to be rescale to the interval |
vars_scale_mean_0_var_1 |
indicated the variables to be rescale to have mean |
Returns a data frame similar to AgricurbAll ready to analyse with the current methods, such as mcmc_PO1_HM1_HM1
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | require(ggplot2)
Agricurb_data <- get_agricurb_data( arc_datasets = "NMeso",
vars_log = c("Rainfall"),
vars_scale_int_0_1 = c("Size", "Rainfall"),
vars_scale_mean_0_var_1 = NULL )
Agricurb_data$ManureLevel <- factor(Agricurb_data$ManureLevel,levels=c("low","medium","high"))
# archaeological data identifier
id_arch <- !is.element(Agricurb_data$dataset,"modern")
#####
# Checking data characteristics
#####
# HM model #
# Relation between Rainfall and normd15N
# (assuming missing data)
p <- ggplot( aes(x=Rainfall,y=normd15N), data=Agricurb_data)
p <- p + geom_point(aes(colour=ManureLevel), pch=20, size=3, alpha=0.7)
p
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.