Recap - Variable Creation
Part of the Fundamentals section of Coddy's R journey — lesson 11 of 78.
Challenge
EasyCreate variables representing different aspects of a product inventory system. You need to create exactly four variables, each with a different data type.
First, create a variable called product_price and assign it the value 29.99. Then create a variable called item_count and assign it the value 150L. Next, create a variable called product_name and assign it the value "Wireless Headphones". Finally, create a variable called in_stock and assign it the value TRUE.
After creating all four variables, display each one using the print() function in this exact order: product_price, item_count, product_name, and in_stock.
Try it yourself
# TODO: Create the four variables with their assigned values
# TODO: Display each variable using print() function in the specified orderAll lessons in Fundamentals
4Operators Part 2
Logical Operators (AND, OR)Logical Operators Part 2 (NOT)Recap - Simple LogicVectorized Logic Part 1Vectorized Logic Part 22Variables and Data Types
Numeric Data TypeInteger Data TypeCharacter Data TypeLogical Data TypeChecking Data TypesNaming ConventionsMissing Values: NARecap - Variable Creation8Loops
For LoopWhile LoopBreakNext (Continue)Recap - FactorialSequence Generation (seq, :)Nested LoopsRecap - Dynamic Input3Operators Part 1
Arithmetic OperatorsInteger Division and ModuloAssignment OperatorsRecap - Simple MathComparison Operators6Basic IO
Print OutputCat for OutputOutput With VariablesReading Input with readline()Type Conversion BasicsRecap - Age CalculatorRecap - True or False9Functions
Declaring a FunctionFunction ArgumentsReturn ValuesRecap - Sigma FunctionRecap - Validation FunctionDefault Parameter Values