Data manipulation in R is an important and foundational topi
Data manipulation in R is an important and foundational topic. What are some basic operations that can be used in R? How can data be stored for later usage in the R?
Solution
Yes , as said, Data Manipulation in R is foundation topic as well as important topic ,
We are doing Data Manipulation by using DPLYR TECHNIQUES in R
We have five verbs of R data manipulation with dplyr: select, mutate, filter, arrange and summarise.
Then we can chain dplyr operations using the pipe operator of the \"magrittr\" package.
and we will do subset the data by using \"group_by\" function,
In R, compleatly basesd on data manipulation tools and techniques to efficiently manipulate data in R.
we have some basic operations to manipulate the data in R, please find them as below.
Here basic operations will act on whole vectore and quicly perform larg number of calculations
if we take to add or subtract or multiply or devided by a value to the multiple values in vectore then we can write easily as below .
> a <- c(10,20,30,40) \\\\create vetore with values 1,2,3,4
> a
[1] 10 20 30 40 \\\\ answer will be as like this for taken values
> a + 5 \\\\ to add 5 to all the values in vector
[1] 15 25 35 45 \\\\ answer will be as like this for addition with 5
> a - 10 \\\\ to subtract from all values in vector
[1] 0 10 20 30 \\\\ answer will be as like this for subtraction with 10
> a*4 \\\\ to multiply with 4 to all the values in vector
[1] 40 80 120 160 \\\\ answer will be as like this for multiplication by 4
> a/5 \\\\ to devided with 5 to all the values in vector
[1] 2 4 6 8 \\\\ answer will be as like this for devided by 5
we can take the result into another vector as like below
> b <- a + 5
> b
[1] 15 25 35 45
we have some more like sqrt, exp , log , ...
An , we have \"load\" or \"attach\" functions are there to later usage of data .
here , we have an best option in R to read back the old data .
we have option \"save.image()\" is just a short cut to save the current workshop ,
it is writes an external representation of R objects to the specified file. this objects can be read back from the file later by using the function \"load\" or \"attach\" (or \"data\" in some cases).
