getExtracted: getExtracted

Description Usage Arguments Value Examples

View source: R/import_metaDigitise.R

Description

Extracts data from a directory that has been previously digitised using metaDigitise()

Usage

1

Arguments

dir

The directory where figures have already been digitised. There

summary

Logical indicating whether summarised (default) or calibrated data should be returned.

Value

Returns a data frame (summary = TRUE) or a list with slots for each plot type (summary = FALSE)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Make some mock metaDigitise object
	mock_metaDig <- list(
			image_file = "./image.png",
			flip=FALSE,
			rotate=0,
			plot_type="mean_error",
			variable="y",
			calpoints = data.frame(x=c(0,0),y=c(0,100)), 
			point_vals = c(1,2), 
			entered_N=TRUE,
			raw_data = data.frame(id=rep("control",2), 
						x=c(60,60), 
						y=c(75,50), 
						n=rep(20,2)),
						knownN = NULL,
						error_type="sd", 
					processed_data=data.frame(
						id=as.factor("control"),
						mean=1.5, 
						error=0.25, 
						n=20, 	
						variable="y", 
						stringsAsFactors = FALSE)	
					)
class(mock_metaDig) <- 'metaDigitise'

# write image file to tmpdir()
		dir <- tempdir()

# Setup directory as it would be if digitised images existed		
		setup_calibration_dir(dir)

# Save the digitised data
		saveRDS(mock_metaDig, file = paste0(dir, "/caldat/", "image"))

#metaDigitise figures
data <- getExtracted(dir)

metaDigitise documentation built on March 13, 2020, 9:09 a.m.