crop.plot2D | R Documentation |
LDAcrop.pro
This function plots the linear discriminant scores from LDAcrop.pro
as a 2D graph.
crop.plot2D(x,ylims=NULL,xlims=NULL,gcol=NULL, gbg=NULL,gpch=NULL, col ='black', bg="black", pch=15,site="Site", Func1=1, Func2=2, label=NULL, pos=c(0,-0.3), lab.col= "black", lab.cex = 0.8)
x |
dataframe containing columns with the LD1, LD2 and LD3 scores - this can be the output of |
ylims |
The limits of the y axis (expressed as c(min, max)) |
xlims |
The limits of the x axis (expressed as c(min, max)) |
gcol |
Symbol colours of the ethnographical crop processing groups written as c("red", "green"...) etc. The default produces a black and white plot |
gbg |
The colour of the background of the symbols of the ethnographical crop processing groups (expressed c("red", "green"...) etc. The default produces a black and white plot) |
gpch |
The symbols of the ethnographical crop processing groups (expressed as c(1, 2, 3, 14, 18)) |
col |
Symbol colour for archaeobotanical data |
bg |
The background(fill) colours for open plot symbols with a pch = 21:25, see points |
pch |
Symbol of the archaeobotanical data |
site |
The name the archaeobotanical data will be labelled as in the legend |
Func1 |
The linear discriminant function to be plotted on the x axis- the default is 1 |
Func2 |
The linear discriminant function to be plotted on the y axis- the default is 2 |
label |
The name of the sample(s) to be labelled on the graph |
pos |
The position of the label (format c(x,y)) |
lab.col |
need to fill |
lab.cex |
need to fill |
The data frame entered as argument x can be the output of LDAcrop.pro
or from manual normalizing. However the data frame must have column labelled LD1, LD2, LD3 containing the linear discriminant scores for function 1, 2 and 3
Elizabeth Stroud
PAPER reference
##Example dataset
LD1<-runif(40, min= -0, max=3)
LD2<-runif(40, min = -2, 4)
LD3<-runif(40, min = 2, 4)
Study<-sample(1:3, 40, replace=TRUE)
data<-data.frame(Study,LD1, LD2, LD3)
###Use with defaults (will return a black and white graph)
crop.plot2D(data)
###Changing whcih discriminant function is ploted
crop.plot2D(data, Func1=2, Func2=3)
##Use with colour and symbol variables
crop.plot2D(data, xlims = c(-5, 5), ylims =c(-5,5), gcol =c("forestgreen", "blue",
"skyblue", "orange"), gpch=c(6,7,8,9), col = "darkred", pch = 20 , site ="Example")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.