Please disable your adblock and script blockers to view this page

Search this blog

Monday, 23 July 2018

Comments and basic arithmetic operations in R programming

 This post is about performing arithmetic operations in R programming language and putting required comments in between of code.

In R we use #(hash) sign to write a single line comment and R does not support multiline comments.

Now we'll see how to perform basic arithmetic operations in R. It is quite simple like using the calculator as no code is required to add, subtract or multiply.
See the example given below and try the code in R GUI software.



#Add Operation
10+12

#Subtract Operation
12-10

#Multiplication
10*12

#Divison
20/10

# Exponentiation
3^3

# Modulo
25%%4

And see the output in R GUI



and you can see that comments are written in code using # sign.

Print Hello World in R

The first program of every programming language is printing "Hello World" on the screen so here we'll see how to write our first program in R.
Here we take a variable sayHello and use <- to assign the value to the variable and to print this variable on the console, use the print command as shown in the below code.

#Set value in a variable 
sayHello <- "Hello World in R Programming!"
#Put this command to print
print(sayHello)

And output in R console - It is printing "Hello World in R Programming"



So this post gives a basic idea about R programming, Now in the next post, we'll learn about variables and data types used in the R language.

Saturday, 21 July 2018

R tutorial - Introduction to R Programming

This R tutorial is designed for beginners who know the basics of programming and want to learn R programming.

R is an open-source programming language utilized for machine learning, factual examination, designs portrayal and detailing. R is unreservedly accessible under GNU General Public License. To learn R programming you ought to have an essential comprehension of any programming language.

The centre of R is an interpreted programming language that is the reason it doesn't require any compiler to run the code. R permits joining with the methodology written in the C, C++, .Net, Python or FORTRAN languages for effectiveness.



R was developed by Ross Ihaka and Robert Gentleman in Auckland in 1993 and supported by a group of programmers. R is the most used programming language for data analysis and statistical purposes. Like other programming languages, R supports conditional statements, looping, recursion and numerous different highlights like information representation, data visualization.

R supports number-crunching, object-oriented programming, procedural programming with functions, and has an extensive arrangement of administrators for taking care of Arrays and grids.

To start learning R programming, first of all, get R GUI Software that compiles and runs the R language.

Tuesday, 10 July 2018

Styling HTML elements using CSS

In this post, we'll learn about styling HTML elements using CSS code, CSS stands for Cascading Style Sheet. It is used for changing the look of HTML components on the page and is very important for designing a beautiful user interface. After this tutorial, you'll be able to learn the basics about CSS and can use it in any type of web application or technology to beautify components.



CSS can be used in HTML pages in 3 ways, Here we'll see how to style HTML elements.

Inline CSS

Inline CSS is used to decorate a single HTML element and makes use of style attributes. See this example of styling HTML paragraph tag using inline CSS

<!DOCTYPE html>
<html>
<body>

<p style="color:red;font-size:20px;font-weight:bold;">This is a Red bold Paragraph</p>
<p style="color:darkgreen;font-size:15px;font-style:italic;">This is a green italic Paragraph</p>

</body>
</html>

Try this in our HTML Editor

Internal CSS

Internal CSS is used to decorate elements in a single HTML page. It is defined between <style> - </style> tag in <head> section. See this example of using internal CSS in an HTML page

<!DOCTYPE html>
<html>
<body>

<style>
p{
color:red;
font-size:20px;
font-weight:bold;
border: 1px solid blue;
padding: 50px;
background-color:yellow;
}
</style>

<p>This is a Red bold Paragraph with a border and background color</p>

</body>
</html>

Try this in our HTML Editor

External CSS

External CSS is used to decorate many HTML pages, Like for designing a website's template we use external CSS, In this, we create a file with .css extension and this file contains CSS code for all page elements.

A CSS file looks like this - style.css

p{
color:red;
font-size:20px;
font-weight:bold;
border: 1px solid blue;
padding: 50px;
background-color:yellow;
}
h1{
color:blue;
}

And this is how it is attached to the HTML page

<!DOCTYPE html>
<html>
<head>
  <link rel="stylesheet" href="style.css">
</head>
<body>

<p>This is a Red bold Paragraph with a border and background color</p>
<h1>This is the H1 heading</h1>
</body>
</html>

After this information, you'll be able to understand the basics of CSS and get an idea of using styles with any other framework.

Cheers :) Happy Learning