Nizamuddin Siddiqui has Published 2307 Articles

How to remove a character in an R data frame column?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 01-Nov-2023 14:50:11

32K+ Views

To remove a character in an R data frame column, we can use gsub() function which will replace the character with blank. For example, if we have a data frame called df that contains a character column say x which has a character ID in each value then it can ... Read More

How to check in C# whether the string array contains a particular work in a string array?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 04-Oct-2023 21:43:08

24K+ Views

In C#, String.Contains() is a string method. This method is used to check whether the substring occurs within a given string or not. It returns the boolean value. If substring exists in string or value is the empty string (""), then it returns True, otherwise returns False. Exception − This ... Read More

How to create a vector with repeated values in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 14-Sep-2023 22:00:00

25K+ Views

There are two methods to create a vector with repeated values in R but both of them have different approaches, first one is by repeating each element of the vector and the second repeats the elements by a specified number of times. Both of these methods use rep function to ... Read More

How to find the R version you are using?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 13-Sep-2023 15:53:58

34K+ Views

Most of the times, we need to use packages in R and some packages are restricted to different versions in R, generally to newer versions. Therefore, we might need to find which version of R we are using. To find the R version, we can directly use the command R.Version().Example Live ... Read More

How to convert more than one column in R data frame to from integer to numeric in a single line code?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 08-Sep-2023 23:06:52

37K+ Views

To convert columns of an R data frame from integer to numeric we can use lapply() function. For example, if we have a data frame df that contains all integer columns then we can use the code lapply(df, as.numeric) to convert all of the columns data type into numeric data ... Read More

How to get only Date portion from DateTime object in C#?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 02-Sep-2023 13:12:30

48K+ Views

There are several ways to get only date portion from a DateTime object.ToShortDateString() − Converts the value of the current DateTime object to its equivalent short date string representation.Returns a string that contains the short date string representation of the current DateTime object.ToLongDateString() − Converts the value of the current ... Read More

How to remove all rows having NA in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 02-Sep-2023 12:07:50

62K+ Views

To remove all rows having NA, we can use na.omit() function. For Example, if we have a data frame called df that contains some NA values then we can remove all rows that contains at least one NA by using the command na.omit(df).That means if we have more than one ... Read More

How to find items in one list that are not in another list in C#?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 13-May-2022 08:25:48

11K+ Views

LINQ Except operator comes under Set operators category in LINQThe Except() method requires two collections and finding those elements which are not present in the second collectionExcept for the extension, the method doesn't return the correct result for the collection of complex types.Example using Except() method Live Demousing System; using System.Collections.Generic; ... Read More

How to find the moving standard deviation in an R matrix?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 23-Nov-2021 06:52:55

271 Views

To find the moving standard deviation in a matrix is done in the same way as in a data frame, we just need to use the matrix object name in place of data frame name. Hence, we can make use of rollapply function of zoo package for this purpose.For example, ... Read More

How to round the summary output in R?

Nizamuddin Siddiqui

Nizamuddin Siddiqui

Updated on 23-Nov-2021 06:49:16

3K+ Views

To round the output of summary function in R, we can use digits argument while applying the summary function.For example, if we have a data frame called df then to find the summary statistics with two digits in the output we can use the below given command −summary(df, digits=2)Example 1Following ... Read More

1 2 3 4 5 ... 231 Next
Advertisements