# R- PROGRAMMING LANGUAGE

# R is a programming language and environment specifically designed for statistical computing and graphics. It provides a wide variety of statistical and graphical techniques, and it is widely used in fields such as data analysis, data visualization, machine learning, and statistical modeling.

# Here are some key features and aspects of the R programming language:

# Open Source: R is an open-source language, which means that its source code is freely available for modification and distribution.

# Statistical Computing: R is particularly well-suited for statistical computing. It has a rich set of statistical and mathematical functions that make it popular among statisticians, data scientists, and researchers.

# Data Manipulation: R provides powerful tools for data manipulation, transformation, and analysis. The language has built-in data structures like vectors, matrices, and data frames that simplify these tasks.

# Graphics and Visualization: R has extensive capabilities for creating a wide range of static and dynamic visualizations. The ggplot2 package is particularly popular for creating high-quality graphics.

# Community and Packages: R has a large and active community of users and developers. The Comprehensive R Archive Network (CRAN) is a repository that hosts thousands of packages contributed by the community, providing additional functionality and tools for various purposes.

# Integration with Other Languages: R can be integrated with other programming languages like C, C++, and Java, allowing users to leverage existing code and libraries.

# Reproducibility: R is designed to support reproducible research. This means that analyses can be easily reproduced by others, contributing to the transparency and reliability of research findings.

# Data Science and Machine Learning: R has become increasingly popular in the field of data science and machine learning. Packages like caret and randomForest are commonly used for machine learning tasks.




# Types of Comments in R
#In general, all programming languages have the following types of comment:single-line comments & multi-line comments
#However, in R programming, there is no functionality for multi-line comments. Thus, you can only write single-line comments in R using "#"


# WRITE YOUR FIRST PROGRAM IN R 
3+6
print("hello R programming")

# Assignment operator <-,-> & = | [Declareing variable]

demo <- "hello how are you"
print(demo)

sum<-4+9
print(sum)

sum1=sum+10
print(sum1)

demo1=2+4;demo2=8+6
print(demo1)
print(demo2) # can run both together we will have to print seperately 


sessionInfo() # This function provides details about the version of R, the operating system, attached packages, and more.

x <- 1:10
plot(x)

# NOTE - R is a case sensative languge ( and & AND are diffrent)


# 1. VARIABLES IN R- PROGRAMMING 

# Naming rules - variable can start with "." or a letter only 
# Other than . and _ no special symn\bols can be in name of variables 
# can include numbers, just nit at the beginning

var_name <- 10 
var.name <- 10 
#_var_name <- 10 # not valid 
#var_nam* <- 10  # not valid 
#5var_name <- 10 # not valid 


# 2. ASSIGNMENT OF VARIABLES 

var10 <- 10 
var20 = 20
10 -> var30

print(var10)
print(var20)
print(var30)

cat(var10," ",var20)  # The cat() function in R is used for concatenating and printing values. 
# If you want to print the values of var10 and var20 with a space in between them, you can use the cat() 

cat(var10," ",var20,"\n",var30)  

# 3. DATA TYPES IN R-PROGRAMMING - Logical , numeric , integer, complex, character , raw 

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: