check.data {fechner} | R Documentation |
check.data
is used to check whether the data are of required
format.
check.data(X, format = c("probability.different", "percent.same", "general"))
X |
a required square matrix or data frame of numeric
data. No NA , NaN , Inf , or -Inf
values are allowed. |
format |
an optional character string giving the data format to
be checked. This must be one of "probability.different" ,
"percent.same" , or "general" , with default
"probability.different" , and may be abbreviated to a unique
prefix. |
The data must be a matrix or data frame, have the same number of rows and columns, and be numeric consisting of real numbers. In particular, no infinite, undefined, or missing values are allowed. This is the general data format. The probability-different and percent-same formats, in addition, require that the data lie in the intervals [0, 1] and [0, 100], respectively. If all of the requirements for a data format are satisfied, the data are returned as a matrix with rows and columns labeled; otherwise the function stops with respective error messages.
The labeling is as follows.
If the data are of required format, check.data
returns a
matrix of the data with rows and columns labeled.
Thomas Kiefer thomas.kiefer@student.uni-augsburg.de, Ali Uenlue ali.uenlue@math.uni-augsburg.de. Based on original MATLAB source by Ehtibar N. Dzhafarov.
Dzhafarov, E. N. and Colonius, H. (2006) Reconstructing distances among objects from their discriminability. Psychometrika, 71, 365–386.
Dzhafarov, E. N. and Colonius, H. (2007) Dissimilarity cumulation theory and subjective metrics. Journal of Mathematical Psychology, 51, 290–304.
Kiefer, T. and Uenlue, A. and Dzhafarov, E. N. (2009) Fechnerian scaling in R: The package fechner. Manuscript submitted for publication. http://www.math.uni-augsburg.de/~uenlueal/
check.regular
for checking regular
minimality/maximality; fechner
, the main function for
Fechnerian scaling. See also fechner-package
for
general information about this package.
## dataset wish is of probability-different format check.data(wish) ## dataset morse is of percent-same format check.data(morse, format = "percent.same") ## a matrix without any labeling of rows and columns, of general format ## check.data does the labeling automatically (X <- ((-1) * matrix(1:16, nrow = 4))) check.data(X, format = "general") ## Not run: ## examples of data that are not of any of the three formats ## error message: data must be matrix or data frame check.data(as.character(matrix(1:16, nrow = 4))) ## error message: data must have same number of rows and columns check.data(matrix(1:12, nrow = 4)) ## error message: data must be numbers check.data(matrix(LETTERS[1:16], nrow = 4)) ## End(Not run)