Learn R, Vector, Matrix and Data Frame Programming Languages - Asia B Technology

Learn R, Vector, Matrix and Data Frame Programming Languages

programming r

How are my forum friends? May you be healthy always yes, Aamiin ;)Well on this occasion, the admin will create an article about the R programming language or commonly called R Programming. Please take note of this article about Learning R Programming Languages, Vectors, Matrix & Data Frames

For learning about Linear Algebra, of course, it has been unfamiliar with Vectors, Matrices and Data Frames.  Of course, R programming is used to accelerate the value as the admin explained above. Please see the discussion below

At first glance, the admin will discuss in advance about the programming language R or R Programming, please check out the language below, yes R Programming Language

R programming language is a programming language intended to analyze statistics in mathematics and can also overcome data that is graphic.

The R programming language was formed by Programmers named Ross Ihaka and Robert Gentlemen at the University of Auckland in New Zealand, and is now developed by the R Development Core Team.

R Programming Language has now become the de facto standard language among scholars for statistical software development and R programming language is also widely used to improve data analysis.

Okay after friends discuss the discussion about R programming next we will learn about the programming language, please see the discussion below: Part 1 Some Objects In R

In part 1 we will learn about Objects in R & how to implement them. So what are we going to learn in these parts?

Below are some of the points that will be discussed for this part 1:VectorListMatrixData Frame

Well above some points that we will discuss in part 1 please see yes friends – friendsVektor

The first step we will create vector A using a series of numbers 1 to 5, then display it next way we will investigate whether A was a vector or not.

For the script, please pay attention to the scritp below:

A <- c(1,2,3,4,five)Ais.atomic(A) #Memeriksa whether A is a vector

Script Explanation:In the script above we can see that we will enter the value into A, namely the number 1 to 5 how to enter the value as follows, then sink on the second line to display the value in A. Please note the image below:

we can see that the results based on the vector are 1 to 5 and from the output of checking the following scripts affect vectors.

B <- c(three,4,two,five)length(B)mean(B)sd(B)max(B)min(B)

Script Explanation:In the script above we will first enter the value of vector B, then:length is a command to call the length of a value that is still present in Vector B.mean is a command to display the average according to Vector Bmax is the command to display the maximum value according to Vector Bmin is a command to display minimum values according to Vector B

For images from the output script above, please note the image below:

From the image above we can see the values according to each command that is executed ranging from homogeneous vector values to looking for minimum values based on vectors earlier.

C <- c(1,five,NA,6,NA,7,4)Cmean(C)mean(C, na.rm=TRUE)length(C)length(na.omit(C))

Script Explanation:Just like the previous explanation, we first enter the value based on Vector C using the command C <-c(1,five,NA,6,NA,7,4)C command was a command to display the value of Vector Cmean is a command to search for a homogeneous-average based on the value of Clength is a command to know the length of Vector C

For the results of the script above can be observed based on the figure below:

From the image above we can see the results based on homogeneous average values to use vector value length

For Scrpit add a please friends follow the script below:

D <- c(“Ugi”,”Egi”,”Andi”)Dwhich.max(na.omit(C))which.max(C)which(!is.na(C))which(is.na(C))CC[1]C[2]C[3]C[c(1:4)]C[c(two,5)]

The above script is some other examples in displaying values based on a VectorFriends can follow the script then please conclude the results based on each command.For output according to the script above please note the image below:

Then how to be able to call a value in a certain order? below are the commands to display exclusive values. Please follow the script below;C[1]C[2]C[3]C[c(1:4)]C[c(2,lima)]

The script explanation above is a way to call each value such as the first value, the second value & the third value and so on.

Next we will learn about the list, well how the hell is it made?Please friends see the script and lighting below:List

Well in this section we will learn about the list, then how the hell is the application of lists in the R Programming language, please refer to the script below:

A <- list(name=c(“Ugi”,”Egi”), sapta=c(5,tiga,five,two,6), kota=c(“Bandung”,”Jakarta”,”Medan”))AA[1]A[two]A[3]is.list(A)is.atomic(A)

Script Explanation:In the script above we can see that in Vector A filled with a list of names, sapta, & cities, then the values are called using the following commands:A = is the create command displaying all values that are in Vector AA[1] = intended to display the list in the first programming r column i.e. nameA[two] = intended to display the list in the 2nd column i.e. saptaA[3] = intended to display the value of the list in the 3rd column i.e. cityis.list(A) = is a check whether the Vector is a list or not

For results based on the script above please note the image below:

The picture above is the result of the script that we write we can see make a description based on each command such as calling the first value or other values.

For the list is indeed short explanation because the list was only a basic knower of the next event that we will later for.

Next we will learn about the matrix, please see the following matrix making is: Matrix

Well for the first part we will investigate how to create a matrix in the R Programming Language earlier, then we will adjust how to call the matrix, check the matrix & call matrix in a list.

First we will create a script using matrix A and Matrix B using column and row values.

A <- matrix(c(4,2,three,five,6,2), nrow = two, ncol = three)AB <- matrix(c(4,two,three,5,6,2), nrow = three, ncol = two)B

Script Explanation:In the script above we will enter a value in matrix a using the matrix command, for the command in Matrix A will enter the value formed with row two and column three. And for Matrix B we will enter the value using creating row three and creating column 2

For results according to the script above, please pay attention to the image below:

In the figure above we can see that Matrix A has 2 rows and 3 columns, while create Matrix B has 3 columns & 2 Rows

Then how to call each matrix value just now? Well please refer to the explanation along with the script below:


Script Explanation:Here is the description based on the script above, please see & understand the explanation below:A[1,1] = Is a command for a value that is in a row of one column oneA[1,2] = Is a command create a value that is in row one column 2A[1,] = Is a command to display one line based on matrix values in row oneA[,1] = Is the command to display the column that is the first column according to the matrixA[,two] = Is a command to display a column that is the second column according to the matrixis.matrix(A) = Command to check whether A is a matrix or notis.list(A) = The command checks whether A is a List or not

Asi B Technology

Silahkan Subscribe untuk Mendapatkan Update Terbaru Sekitar Technology

We don’t spam! Read our privacy policy for more info.