Articles on Trending Technologies

Technical articles with clear explanations and examples

Tutorix - AI Tutor

Node.js – hash.copy() Method

Mayank Agarwal
Mayank Agarwal
Updated on 16-Aug-2021 390 Views

The Hash class is one of the many utility classes that is used for creating the hash digests of data. The hash.copy() method creates a new Hash object that will contain a deep copy of the internal state of the current hash object.Syntaxhash.copy([options])Parametersoptions −This input parameter takes input to control the stream behaviour and therefore will contain the stream.tranformOptions.Example 1Create a file "hashCopy.js" and copy the following code snippet. After creating the file, use the command "node hashCopy.js" to run this code.// hash.update() demo Example // Importing the crypto module const crypto = require('crypto'); // Defining the hash ...

Read More

How to create a correlation matrix by a categorical column in data.table object in R?

Nizamuddin Siddiqui
Nizamuddin Siddiqui
Updated on 14-Aug-2021 1K+ Views

To create a correlation matrix by a categorical column in data.table object in R, we can follow the below steps −First of all, create a data.table object.Then, find the correlation matrix by splitting the object based on categorical column.Create the data.table objectLoading data.table package and creating a data.table object −library(data.table) x

Read More

What are the different color palettes we have in RColorBrewer package?

Nizamuddin Siddiqui
Nizamuddin Siddiqui
Updated on 14-Aug-2021 386 Views

The different color palettes can be found by using display.brewer.all() function. Each of the palette has different colors. There are three types of palettes defined with names equential, diverging, and qualitative. They are defined for specific uses as written below −Sequential palettes are suited to ordered data that progress from low to high.Diverging palettes put equal emphasis on mid-range critical values and extremes at both ends of the data range.Qualitative palettes are best suited to representing nominal or categorical data.Find the color palettes in RColorBrewer packageInstalling and Loading RColorBrewer package and finding the different color palettes −install.packages("RColorBrewer") library(RColorBrewer) display.brewer.all()On executing, ...

Read More

How to randomize column values of a data.table object for all columns in R?

Nizamuddin Siddiqui
Nizamuddin Siddiqui
Updated on 14-Aug-2021 375 Views

To randomize column values of a data.table object for all columns in R, we can follow the below steps −First of all, create a data.table object.Then, use sample function with lapply to randomize the columns of the data.table object.Create the data frameLet's create a data frame as shown below −library(data.table) x

Read More

How to add values in columns having same name and merge them in R?

Nizamuddin Siddiqui
Nizamuddin Siddiqui
Updated on 14-Aug-2021 2K+ Views

To add values in columns having same name and merge them in R, we can follow the below steps −First of all, create a data frame.Add column values that have same name and merge them by using cbind with do.call.Create the data frameLet's create a data frame as shown below −df

Read More

How to change the color of line of a plot created for an xts object in R?

Nizamuddin Siddiqui
Nizamuddin Siddiqui
Updated on 14-Aug-2021 336 Views

To change the color of line of a plot created for an xts object in R, we can follow the below steps −First of all, create a data frame.Then, convert this data frame into an xts object.Create the plot for the data in xts object with default color.Then, create the plot for the data in xts object with different colorCreate the data frameLet's create a data frame as shown below −Dates

Read More

How to add a column to data.table object in R?

Nizamuddin Siddiqui
Nizamuddin Siddiqui
Updated on 13-Aug-2021 6K+ Views

To add a column to data.table object, we can follow the below steps −First of all, create a data.table object.Add a column to the object using := functionCreate the data.table objectLet’s create a data.table object as shown below −library(data.table) x

Read More

How to find the number of rows in a data.table where two or more column values meet a criteria in R?

Nizamuddin Siddiqui
Nizamuddin Siddiqui
Updated on 13-Aug-2021 566 Views

To find the number of rows in a data.table where two or more column values meet a criteria, we can follow the below steps −First of all, create a data.table object.Find the number of rows meeting a criteria.Create data.table objectLet’s create a data.table object as shown below −x

Read More

Why do we need a Valuation Approach in performing Finance Functions?

Probir Banerjee
Probir Banerjee
Updated on 13-Aug-2021 292 Views

Valuation is the process of finding the present value of a business. It can be done in many ways but some factors are needed for valuation, such as the probable future earnings, management structure of the business, the market capitalization of the company’s assets, and its capital budgeting structure composition.Valuation is also done to find out the fair value of a security which a buyer will pay the seller. Intrinsic valuation tells the analysts the investors in the share market whether a stock is under or overvalued and depending on this the future value of the stock is determined.Note − ...

Read More

How do you compute the future value of a lump-sum amount and an annuity?

Probir Banerjee
Probir Banerjee
Updated on 13-Aug-2021 1K+ Views

Calculation of the future value of a lump sum may be necessary for many reasons. The investors or lenders may want to know how much they will get for their lump-sum investment after a specific period of time. Knowing the future value is important for the borrower is important too because he or she has to pay the total amount of lump-sum plus any interest on them.Future Value of a Lump-sum AmountWe know that, Future Sum = Principal + Interest Rate on PrincipalSo, for the first year, F1 = P + P x i = P (1+i)F2 = F1 + ...

Read More
Showing 48401–48410 of 61,298 articles
Advertisements