scatterplot.r2p: Draw a scatterplot with or without category/group and add R...

scatterplot.r2pR Documentation

Draw a scatterplot with or without category/group and add R square and p-value automatically

Description

The function could be used as drawing a scatterplot with or without category/group variable. In addition, r2 and p for fitted regression lines can be shown automatically.

Usage

scatterplot.r2p(dat,x = x,y = y,group = NULL, color=NULL, pty=NULL, cex.size=1,cornerlabel=NULL,r2.p.pos=c(0.1,0.95),level.off=FALSE,blank=0,...) 

Arguments

dat

a data.frame.

x

a variable in x axis.

y

a variable in y axis.

group

a group variable; the group default is NULL.

color

a color array for different groups.

pty

a array on point types, which the length should match the number of group levels.

cex.size

a cex size in figure options.

cornerlabel

add a marker at corner position.

r2.p.pos

the position of r2.p which ranges from (0,1) for x and y axises.

level.off

whether level is shown or not.

blank

modify the distance between level marker and r2.p text.

Examples

data(leaflife,package='smatr')
	
scatterplot.r2p(dat=leaflife, x = 'longev', y = 'lma', pty = 19)

scatterplot.r2p(dat=leaflife, x = 'longev',y = 'lma', group = 'soilp', pty = c(1, 19))


liuguofang/figsci documentation built on Nov. 24, 2023, 1:45 p.m.