A data type is nothing but an attribute of a value. Computer. It can be classified into different aspects. FOLDOC define data type as:
"a set of values from which a variable, constant, function, or other expression may take its value..."
In a computing environment, there can be data types like an integer (numbers), float (decimals), Booleans, and string. In this article, data/value types of Google Sheets, R, and Python are briefly discussed below.
#1 Google Sheets
Google Sheets is one of the prominent statistical tools. It is associated with several powerful functions like QUERY, VLOOKUP, TEXT, and REGEX etc. In Google Sheets, there is a function called TYPE() which allows us to find the type of a given value in the cells.
![]() |
| Fig.1 |
For boolean we can use any operators like AND/OR. In that case, AND operator has been used (e.g =AND(2,3) in A5). For array =Type({2;3;4}) has been used.
This is how we can identify the type of data or value.
#2 R
Fig.2 shows the console of R. To know about data types, we need to command for that particular inspection is class(). We can take a look at the documentation of the "class" object using the help() command (Fig.3). We can see (Fig.2) the variables (v,w,x,y,z,met,and df) set for each type. So, the data type/class of the variable "v" is "numeric" followed by "w" is "character" (string); "x" is "logical"; "y" is a vector and it can be factorized ("z"); "met" is "matrix" (associated with an array); "xx" is "list"; "df" is "data.frame."
![]() |
| Fig.4 |
This is the output of the matrix (1) and the dataframe (2).
#3 Python
Like R, Python also provides some built-in data types: numerics, sequences, mappings, classes, instances, and exceptions. This section depicts 10 common data types. To know more about data types, users can go through the documentation part. Data types are basically used for Unicode strings and binary data.
We need to use print(type())command to inspect the data types. The variables are set as alphabets. These are
- a= 20 is an integer (int);
- b= 20>10 is a logical condition (bool);
- c=20.5 is a float value as it comprises a decimal;
- d= 200j is a complex data type, for example, if we write d=complex(891j), and print(d),then it will return 891j as a complex one;
- e=["this","is","LIS"] is a list, mainly data within square brackets in particular, will be called as list;
- f=("this","is","LIS") is a tuple;
- g=range(5) is a range, it will print range(0, 5);
- h="This is LIS" is a string (str);
- m={"this","is","LIS"} is a set;
- n={"Name" : "ABC", "Dept" : "LIS"} is for creating/mapping new disctionary (dict);
Data types are important aspects in computing and programming. First, we do not need to code any line to inspect types in Google Sheets, but we need to mention the above class/type command in R and Python.
This article is for educational purposes. For improvement, kindly contact the author.
Share it:





