Count

 

Description

Counts elements in a vector.

Notes:

Count function counts elements by column. If you want to count the numeric values in multiple datasets by row, you can use syntax sum(vd) to sum dataset by row and generate temporary datasets of related statistics values, and then use _npts to get the number of numeric values. Alternatively, use sum(vd)_n in Set Values or F(x) =. See the sum() function for more information.

Note that Sum only counts numeric values.

Syntax

int Count(vd[,int n])

Parameters

vd

A specified column in Origin worksheet.

n

An integer value, typically optional
0 (default) Counts the number of elements in the vector, size of the vector
1 Counts the number of Numeric Values
2 Counts the number of Missing Values(NANUM)
3 Counts the number of elements excluding Missing Values
4 Counts the number of hidden rows

Return

Return the number of specified object by n.

Example

int dd=count(col(a),2);
dd=; //Should return the number of missing values in col(A).