interp_df {voice}R Documentation

Inperpolate data frames

Description

Interpolate data frames using multicore, compressing to compact.to fraction. May remove zeros.

Usage

interp_df(
  x,
  compact.to,
  id = colnames(x)[1],
  colnum = NULL,
  drop.x = TRUE,
  drop.zeros = FALSE,
  to.data.frame = TRUE,
  round.off = NULL,
  weight = NULL,
  mc.cores = 1
)

Arguments

x

A data frame.

compact.to

Proportion of remaining points after interpolation. If equals to 1 and keep.zeros = TRUE, the original vector is presented.

id

The identification column. Default: colname of the first column of x.

colnum

A char vector indicating the numeric colnames. If NULL, uses the columns of the numeric class.

drop.x

Logical. Drop columns containing .x? Default: TRUE.

drop.zeros

Logical. Drop repeated zeros or keep 1 zero per null set? Default: FALSE.

to.data.frame

Logical. Should return a data frame? If FALSE returns a list. Default: TRUE.

round.off

Number of decimal places of the interpolated y. Default: NULL.

weight

Vector of weights with same length of y. Default: NULL.

mc.cores

The number of cores to mclapply. Default: 1.

Value

A data frame of interpolated values with nrow near to compact.to*length(x).

See Also

interp, interp_mc

Examples

library(voice)

# get path to audio file
path2wav <- list.files(system.file('extdata', package = 'wrassp'),
pattern = glob2rx('*.wav'), full.names = TRUE)

# getting Media data frame via lean call
M <- extract_features(dirname(path2wav), features = c('f0','fmt'),
mc.cores = 1, verbose = FALSE)


(cM.df <- interp_df(M[,-(1:2)], 0.1, mc.cores = 1))
(cM.df2 <- interp_df(M[,-(1:2)], 0.1, drop.x = FALSE, mc.cores = 1))

dim(M)
dim(cM.df)
dim(cM.df2)
(cM.list <- interp_df(M[,-(1:2)], 0.1, to.data.frame = FALSE, mc.cores = 1))


[Package voice version 0.4.21 Index]