Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Articles on Trending Technologies
Technical articles with clear explanations and examples
How to split a data frame in R into multiple parts randomly?
When a data frame is large, we can split it into multiple parts randomly. This might be required when we want to analyze the data partially. We can do this with the help of split function and sample function to select the values randomly.ExampleConsider the trees data in base R −> str(trees) 'data.frame': 31 obs. of 3 variables: $ Girth : num 8.3 8.6 8.8 10.5 10.7 10.8 11 11 11.1 11.2 ... $ Height: num 70 65 63 72 81 83 66 75 80 75 ... $ Volume: num 10.3 10.3 10.2 16.4 18.8 19.7 15.6 18.2 22.6 19.9 ...
Read MoreHow to convert empty values to NA in an R data frame?
When our data has empty values then it is difficult to perform the analysis, we might to convert those empty values to NA so that we can understand the number of values that are not available. This can be done by using single square brackets.ExampleConsider the below data frame that has some empty values −> x1 x2 x3 df df x1 x2 x3 1 1 2 5 2 2 2 5 3 3 2 4 4 1 2 4 5 2 4 4 6 3 4 4 7 1 4 4 8 2 4 2 9 3 2 10 1 2 11 2 12 3 13 1 4 14 2 4 15 3 4 16 4 17 18 19 2 20 1Converting empty values to NA −> df[df == ""] df x1 x2 x3 1 1 2 5 2 2 2 5 3 3 2 4 4 1 2 4 5 2 4 4 6 3 4 4 7 1 4 4 8 2 4 2 9 3 2 10 1 2 11 2 12 3 13 1 4 14 2 4 15 3 4 16 4 17 18 19 2 20 1
Read MoreHow to remove empty rows from an R data frame?
During the survey or any other medium of data collection, getting all the information from all units is not possible. Sometimes we get partial information and sometimes nothing. Therefore, it is possible that some rows in our data are completely blank and some might have partial data. The blank rows can be removed and the other empty values can be filled with methods that helps to deal with missing information.ExampleConsider the below data frame, it has some missing rows and some missing values −> x1 x2 x3 df df x1 x2 x3 1 1 2 5 2 2 2 5 ...
Read MoreHow to select columns in R based on the string that matches with the column name using dplyr?
Selection of columns in R is generally done with the column number or its name with $ delta operator. We can also select the columns with their partial name string or complete name as well without using $ delta operator. This can be done with select and matches function of dplyr package.ExampleLoading dplyr package −> library(dplyr)Consider the BOD data in base R −> str(BOD) 'data.frame': 6 obs. of 2 variables: $ Time : num 1 2 3 4 5 7 $ demand: num 8.3 10.3 19 16 15.6 19.8 - attr(*, "reference")= chr "A1.4, p. 270"Selecting the column of BOD ...
Read MoreHow to select the first row for each level of a factor variable in an R data frame?
Comparison of rows is an influential part of data analysis, sometimes we compare variable with variable, value with value, case or row with another case or row, or even a complete data set with another data set. This is required to check the accuracy of data values and its consistency therefore we must do it. For this purpose, we need to select the required rows, columns etc. To select the first row for each level of a factor variable we can use duplicated function with ! sign.ExampleConsider the below data frame −> x1 x2 x3 df head(df, 20) x1 ...
Read MoreHow to create line chart for all columns of a data frame a in R?
To check the trend of all columns of a data frame, we need to create line charts for all of those columns. These line charts help us to understand how data points fall or rise for the columns. Once we know the trend, we can try to find the out the reasons behind them and take appropriate actions. We can plot line charts for each of the column by using plot.ts function that plots data as a time series.ExampleConsider the below data frame.> set.seed(1) > x1 x2 x3 x4 x5 x6 df head(df, 20) x1 x2 x3 x4 x5 x6 ...
Read MoreHow to find the index of the minimum and maximum value of a vector in R?
While doing the data exploration in an analytical project, we sometimes need to find the index of some values, mostly the indices of minimum and maximum values to check whether the corresponding data row has some crucial information or we may neglect it. Also, these values sometimes transformed to another values based on the data characteristics if we don’t want to neglect them.Example> x which(x==min(x)) [1] 1 > which(x==max(x)) [1] 25 > set.seed(2) > x1 x1 [1] 85 79 70 6 32 8 17 93 81 76 41 50 75 65 3 80 96 50 55 [20] 63 8 33 ...
Read MoreDefine preference shares used in financial management.
These shareholders have preferential right to get dividend and initial investment at the time of winding up the company. They get fixed dividend and they don’t have voting rights.Preference share are classified into following typesCumulative preference shares − They have right to claim dividends for years, which does not have no profits. They have right to get comparative dividend for previous years, if the company earned profitNon-cumulative preference shares − They don’t have right to the rights, that have been enjoyed by cumulative preference shareholders. They have only earned dividend, if the company is earning profits.Redeemable preference share − If ...
Read MoreDefine equity shares used in financial management.
Equity shareholders are real owners of the company and have control over the management. Liabilities of the equity shareholders is the value of unpaid value of shares. They can’t be redeemed during the life time of the company.Features of equity sharesFollowing are the features of equity shares −Maturity of the shares − There is no maturity period for equity shares.Residual claim on income − They get their income left after paying dividend to preference shares. Their earnings equal to profit after tax minus preference dividend.Residual claims on assets − They have right to claim right to get claims on assets.Right ...
Read MoreExplain types and characters of security finance in finance.
Security finance is also called corporate securities. In this, funds are mobilised through shares and debentures. These kinds of funds play an important role in capital structure of a company.Characters of security finance are as followsLong term source of finance.Corporate securities.Repayment of finance is very limited.Plays major role in capital structure of a company.It includes both shares and debentures.Major role in company’s capitalisation.Types of security financesThe types of security finances are as follows −Ownership securities or capital stockCommonly called as shares. Shares are most common method of raising finance by a firm.Equity shares.Preference shares.No par stock.Deferred shares.Creditors’ securities or debt ...
Read More