In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly shows you the "sample analysis of R language data types and corresponding operations". The content is simple and clear. I hope it can help you solve your doubts. Let me lead you to study and learn the article "sample Analysis of R language data types and corresponding operations".
Constant and variable 1. Constant
The basic data types of R language are numeric, logical (TRUE, FALSE), text (string). Missing values are supported and there are special plural types.
Constants are values written directly in the program.
Numerical constants include integer, single precision, double precision and so on, which generally do not need to be distinguished. Write in ways such as 123,123.45 1.2E-2-123.45 ther 0.012, 123,-mai, etc. To indicate that 123 is an integer, it can be written as 123L.
Character-type constants are surrounded by two double apostrophes or two single apostrophes, such as "Li Ming" or'Li Ming'. The character type supports Chinese, such as "Li Ming" or "Li Ming". The main Chinese codes in China are GBK coding and UTF-8 coding, and sometimes they encounter the problem of garbled codes caused by coding errors. R programs under MS Windows generally use GBK coding, but RStudio software uses UTF-8 coding. In R software, strings are generally saved by UTF-8 coding.
Logical constants are only TRUE and FALSE.
The missing value is represented by NA. Missing values are often encountered in statistical calculation, indicating that records are lost, cannot be used because of errors, there is no data on holidays, and so on. In addition to numeric values, logical and character types can also have missing values, and the white space values of character types are not automatically identified as missing values and need to be specified by themselves. R supports special Inf values, which are real values that represent positive infinity and are not missing values.
Complex constant writing methods such as 2.2 + 3.5i, 1i, etc.
two。 Variable
Variables in a program language are used to hold input values or calculated values. In R, variables can hold all data types, such as scalars, vectors, matrices, data boxes, functions, and so on.
All variables have variable names. R variable names must consist of letters, numbers, underscores and periods. The first character of a variable name cannot be taken as a number. In the Chinese environment, Chinese characters can also be used as legal characters of variable names. Variable names are case sensitive, and y and Y are two different variable names.
Examples of variable names: X, x1, X, cancer.tab, clean_data, diseaseData.
Use
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.