R演算子 - W3Schools
原題: R Operators - W3Schools
分析結果
- カテゴリ
- 教育
- 重要度
- 50
- トレンドスコア
- 14
- 要約
- この記事では、Rプログラミング言語における演算子の種類と使用方法について説明しています。Rには、算術演算子、比較演算子、論理演算子、代入演算子などがあり、それぞれの機能や使い方の例が示されています。これにより、Rを使ったデータ分析やプログラミングの基礎を理解するのに役立ちます。
- キーワード
R Operators Menu Search field × See More Sign In ★ +1 Get Certified Upgrade Teachers Spaces Bootcamps Get Certified Upgrade Teachers Spaces Bootcamps ❮ ❯ HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS DSA TYPESCRIPT ANGULAR ANGULARJS GIT POSTGRESQL MONGODB ASP AI R GO KOTLIN SWIFT SASS VUE GEN AI SCIPY AWS CYBERSECURITY DATA SCIENCE INTRO TO PROGRAMMING INTRO TO HTML & CSS BASH RUST TOOLS R Tutorial R HOME R Intro R Get Started R Syntax Syntax Print R Comments R Variables Variables Concatenate Elements Multiple Variables Variable Names R Data Types R Numbers R Math R Strings Strings Escape Characters R Booleans R Operators R If...Else If...Else Nested If And Or R While Loop R For Loop For Loop Nested Loop R Functions Functions Nested Functions Recursion Global Variables R Data Structures R Data Structures R Vectors R Lists R Matrices R Arrays R Data Frames R Factors R Graphics R Plot R Line R Scatterplot R Pie Charts R Bars R Statistics R Statistics Intro R Data Set R Max and Min R Mean Median Mode R Mean R Median R Mode R Percentiles R Cert R Certificate R Examples R Examples R Compiler R Exercises R Quiz R Practice Problems R Syllabus R Study Plan R Operators ❮ Previous Next ❯ Operators Operators are used to perform operations on variables and values. In the example below, we use the + operator to add together two values: Example 10 + 5 Try it Yourself » R divides the operators in the following groups: Arithmetic operators Assignment operators Comparison operators Logical operators Miscellaneous operators R Arithmetic Operators Arithmetic operators are used with numeric values to perform common mathematical operations: Operator Name Example Try it + Addition x + y Try it » - Subtraction x - y Try it » * Multiplication x * y Try it » / Division x / y Try it » ^ Exponent x ^ y Try it » %% Modulus (Remainder from division) x %% y Try it » %/% Integer Division x%/%y Try it » R Assignment Operators Assignment operators are used to assign values to variables: Example my_var <- 3 my_var <<- 3 3 -> my_var 3 ->> my_var my_var # print my_var Try it Yourself » Note: <<- is a global assigner. You will learn more about this in the Global Variable chapter . It is also possible to turn the direction of the assignment operator. x <- 3 is equal to 3 -> x R Comparison Operators Comparison operators are used to compare two values: Operator Name Example Try it == Equal x == y Try it » != Not equal x != y Try it » > Greater than x > y Try it » < Less than x < y Try it » >= Greater than or equal to x >= y Try it » <= Less than or equal to x <= y Try it » R Logical Operators Logical operators are used to combine conditional statements: Operator Description & Element-wise Logical AND operator. Returns TRUE if both elements are TRUE && Logical AND operator - Returns TRUE if both statements are TRUE | Elementwise- Logical OR operator. Returns TRUE if one of the statements is TRUE || Logical OR operator. Returns TRUE if one of the statements is TRUE ! Logical NOT - Returns FALSE if statement is TRUE R Miscellaneous Operators Miscellaneous operators are used to manipulate data: Operator Description Example : Creates a series of numbers in a sequence x <- 1:10 %in% Find out if an element belongs to a vector x %in% y %*% Matrix Multiplication x <- Matrix1 %*% Matrix2 Note: You will learn more about Matrix multiplication and matrices in a later chapter. ❮ Previous Next ❯ ★ +1 Sign in to track progress COLOR PICKER REMOVE ADS PLUS SPACES GET CERTIFIED FOR TEACHERS BOOTCAMPS CONTACT US × Contact Sales If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail: [email protected] Report Error If you want to report an error, or if you want to make a suggestion, send us an e-mail: [email protected] Top Tutorials HTML Tutorial CSS Tutorial JavaScript Tutorial How To Tutorial SQL Tutorial Python Tutorial W3.CSS Tutorial Bootstrap Tutorial PHP Tutorial Java Tutorial C++ Tutorial jQuery Tutorial Top References HTML Reference CSS Reference JavaScript Reference SQL Reference Python Reference W3.CSS Reference Bootstrap Reference PHP Reference HTML Colors Java Reference AngularJS Reference jQuery Reference Top Examples HTML Examples CSS Examples JavaScript Examples How To Examples SQL Examples Python Examples W3.CSS Examples Bootstrap Examples PHP Examples Java Examples XML Examples jQuery Examples Get Certified HTML Certificate CSS Certificate JavaScript Certificate Front End Certificate SQL Certificate Python Certificate PHP Certificate jQuery Certificate Java Certificate C++ Certificate C# Certificate XML Certificate FORUM ABOUT ACADEMY W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use , cookies and privacy policy . Copyright 1999-2026 by Refsnes Data. All Rights Reserved. W3Schools is Powered by W3.CSS . -->