- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Nizamuddin Siddiqui has Published 2307 Articles
Nizamuddin Siddiqui
3K+ Views
There is no function in base R to simulate discrete uniform random variable like we have for other random variables such as Normal, Poisson, Exponential etc. but we can simulate it using rdunif function of purrr package.The rdunif function has the following syntax −> rdunif(n, b , a)Here, n = ... Read More
Nizamuddin Siddiqui
417 Views
The main difference between require and library is that require was designed to use inside functions and library is used to load packages. If a package is not available then library throws an error on the other hand require gives a warning message.Using library> library(xyz) Error in library(xyz) : there ... Read More
Nizamuddin Siddiqui
8K+ Views
The error “could not find function” occurs due to the following reasons −Function name is incorrect. Always remember that function names are case sensitive in R.The package that contains the function was not installed. We have to install packages in R once before using any function contained by them. It ... Read More
Nizamuddin Siddiqui
606 Views
An inner join return only the rows in which the left table have matching keys in the right table and an outer join returns all rows from both tables, join records from the left which have matching keys in the right table. This can be done by using merge function.ExampleInner ... Read More
Nizamuddin Siddiqui
5K+ Views
The use of set.seed is to make sure that we get the same results for randomization. If we randomly select some observations for any task in R or in any statistical software it results in different values all the time and this happens because of randomization. If we want to ... Read More
Nizamuddin Siddiqui
1K+ Views
We can do this by using filter and grepl function of dplyr package.ExampleConsider the mtcars data set.> data(mtcars) > head(mtcars) mpg cyl disp hp drat wt qsec vs am gear carb Mazda RX4 21.0 6 160 110 3.90 2.620 16.46 0 1 4 4 Mazda RX4 Wag 21.0 6 160 ... Read More
Nizamuddin Siddiqui
724 Views
This can be done by using theme argument in ggplot2Example> df df x y 1 long text label a -0.8080940 2 long text label b 0.2164785 3 long text label ... Read More
Nizamuddin Siddiqui
744 Views
The easiest way to do it is by using select_if function of dplyr package but we can also do it through lapply.Using dplyr> df df X1 X2 X3 X4 X5 1 1 11 21 a k 2 2 12 22 b l 3 3 13 23 c m 4 ... Read More
Nizamuddin Siddiqui
883 Views
We can do this by setting the column to NULLExample> library(data.table) > df data_table data_table[, x:=NULL] > data_table numbers 1: 1 2: 2 3: 3 4: 4 5: 5 6: 6 7: 7 8: 8 9: 9 10: 10To delete two columns> df Data_table Data_table numbers 1: 0 2: 1 3: 2 4: 3 5: 4 6: 5 7: 6 8: 7 9: 8 10: 9
To Continue Learning Please Login
Login with Google