FacialExpression: FacialExpression

Usage Examples

View source: R/FacialExpression.R

Usage

1

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
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function () 
{
    Dat <- read.table("a_affirmative_datapoints.txt", header = FALSE, 
        nrows = 1, stringsAsFactors = FALSE)
    file_a <- list.files(pattern = "a_[a-zA-Z|_]*_datapoints+")
    for (i in 1:length(file_a)) {
        temp <- as.data.frame(fread(file_a[i], header = FALSE, 
            sep = " "))
        Dat <- rbind(Dat, temp[-1, ])
        cat("\r", "I'm reading the facial expressions >>>>>>>>>>>>>", 
            paste(round(i/length(file_a) * 100, digits = 2), 
                "%"), ">>>>>>>>>>>>>>>>>>")
    }
    cat("\n")
    Dat_name <- as.character(Dat[1, -1])
    Dat_a <- Dat[-1, -1]
    names(Dat_a) <- Dat_name
    file_a_target <- list.files(pattern = "a_[a-zA-Z|_]*_target+")
    Target <- c(10)
    for (i in 1:length(file_a_target)) {
        Target <- rbind(Target, as.vector(read.table(file_a_target[i], 
            header = FALSE)))
        cat("\r", "I'm reading the targeting vector >>>>>>>>>>>>>", 
            paste(round(i/length(file_a_target) * 100, digits = 2), 
                "%"), ">>>>>>>>>>>>>>>>>>")
    }
    cat("\n")
    Target <- as.vector(Target[-1, 1])
    names(Target) <- "Target"
    return(cbind(Target, Dat_a))
  }

pingqingsheng/Robot0001 documentation built on May 5, 2019, 5:53 p.m.