Articles on Trending Technologies

Technical articles with clear explanations and examples

How to create a plot in base R with dates sequence on X-axis?

Nizamuddin Siddiqui
Nizamuddin Siddiqui
Updated on 11-Mar-2026 2K+ Views

If we have a vector that contains dates as sequence that needs to be plotted on the X-axis and another vector for the response then the plot can be simply created by using the plot function. In the plot function, we would need to pass the dates as the first argument and the response vector as the second argument. Check ou the examples below to understand how it works.Examplex

Read More

Delete array element in given index range [L – R] in C++?

AmitDiwan
AmitDiwan
Updated on 11-Mar-2026 647 Views

Let us first define the original array and the exclusive range for deletion of the array elements and also find the original array length −int arr[] = { 2, 4, 6, 8, 10, 12, 14, 16, 18, 20}; int L = 2, R = 6; int length = sizeof(arr) / sizeof(arr[0]);Now we loop in the array and if index position (i) is greater than L or R we increment the variable k which will be used to shift positions(delete) of array element once the index value (i) lies between the range L and R. Also, the new length of the ...

Read More

How to create a plot of quadratic regression with fitted values against X in base R?

Nizamuddin Siddiqui
Nizamuddin Siddiqui
Updated on 11-Mar-2026 274 Views

The quadratic regression model can be plotted by using the plot function but we would need to find the fitted values using the model and this can be done with the help of fitted function. For example, if we have a quadratic model M and the data has an independent variable x then the model against x can be created by using plot(x,fitted(M)).Examplex1

Read More

Delete leaf nodes with value as x in C++?

AmitDiwan
AmitDiwan
Updated on 11-Mar-2026 271 Views

Let us first define the struct that would represent a tree node that contains the data and its left and right node child. If this is the first node to be created then it’s a root node otherwise a child node.struct Node {    int data;    struct Node *leftChild, *rightChild; };Next we create our newNode(int data) function that takes an int value and assign it to the data member of the node. The function returns the pointer to the created struct Node. Also the left and right child of the newly created node are set to null.struct Node* newNode(int ...

Read More

What is the shortest way to round to the integer value in R?

Nizamuddin Siddiqui
Nizamuddin Siddiqui
Updated on 11-Mar-2026 200 Views

The shortest way to round to the integer value is using trunc function. The trunc function is used to return the largest integer that is smaller than or equal to the actual value, that means it rounds downs to the nearest integer. It works as a ceiling function for negative number and floor function for positive number.Examplex1

Read More

Delete leaf nodes with value k in C++?

AmitDiwan
AmitDiwan
Updated on 11-Mar-2026 199 Views

Let us first define the struct that would represent a tree node that contains the data and its left and right node child. If this is the first node to be created then it’s a root node otherwise a child node.struct Node {    int data;    struct Node *leftChild, *rightChild; };Next we create our newNode(int data) function that takes an int value and assign it to the data member of the node. The function returns the pointer to the created struct Node. Also, the left and right child of the newly created node are set to null.struct Node* newNode(int ...

Read More

How to perform tukey HSD in base R?

Nizamuddin Siddiqui
Nizamuddin Siddiqui
Updated on 11-Mar-2026 1K+ Views

First thing you must remember while moving on to post hoc analysis is the null hypothesis of the analysis of variance must be rejected, so that we can claim there exists a difference in the group means. Now, once we achieve that the tukey HSD can be performed simply by using TukeyHSD function in base R.ExampleConsider the below data frame −x1

Read More

How to combine vectors of equal length into a list with corresponding elements representing a single element of the list in R?

Nizamuddin Siddiqui
Nizamuddin Siddiqui
Updated on 11-Mar-2026 503 Views

To combine three vectors into a list with corresponding elements representing a single element of the list we can use mapply function. For example, if we have three vectors x, y, and z each having number of elements equal to one-hundred then the list with corresponding elements can be created by using mapply(c,x,y,z,SIMPLIFY=FALSE).Examplex1

Read More

How to find percentile rank for groups in an R data frame?

Nizamuddin Siddiqui
Nizamuddin Siddiqui
Updated on 11-Mar-2026 1K+ Views

The word percentile means the percentage that falls below or above the percentile value. For example, if we have a value that lies at 50th percentile then we would say 50 percent of the values lies below or above that value. The value 50 here is called the percentile rank. To find the percentile rank for groups in an R data frame, we can use mutate function of dplyr package.ExampleConsider the below data frame −Group

Read More

Deleting a binary tree using the delete keyword in C++?

AmitDiwan
AmitDiwan
Updated on 11-Mar-2026 244 Views

Let us first define our binary tree using a class containing int data, btree_node * rightChild, btree_node * leftChild. The leftChild and rightChild are pointers to btree_node. All the members in our class are public.class btree_node {    public:       int data;       btree_node* leftChild;       btree_node* rightChild;For creating a new node we have the constructor function that takes the int value as parameter to assign it to the newly created node value. The leftChild and rightChild are set to null.btree_node(int data){    this->data = data;    this->leftChild = NULL;    this-> = NULL; ...

Read More
Showing 25761–25770 of 61,297 articles
Advertisements