I'm trying to figure out a formula to be able to divide the max and min number inside the intervals.

Nov 16, 2018 393 views

## 1 answer to this question.

```#One possible solution is to split by (,] (xout is your dataframe)

x1<-strsplit(as.character(xout\$factorx),",|\\(|]")
x2<-do.call(rbind,x1)
xout\$lower=as.numeric(x2[,2])
xout\$higher=as.numeric(x2[,3])
xout\$ave<-rowMeans(xout[,c("lower","higher")])

factorx Freq cumFreq relative higher lower   aver
1 (9.97,13.7]   15      15     0.15   13.7  9.97 11.835
2 (13.7,17.5]   14      29     0.14   17.5 13.70 15.600
3 (17.5,21.2]   12      41     0.12   21.2 17.50 19.350```
• 10,840 points

+1 vote

## How can I find number of rows in a dataframe, and how to find the number of rows that dont have null values

Use nrow() to find number of rows ...READ MORE

+1 vote

## How to count the number of elements with the values in a vector?

Use dplyr function group_by(). > n = as.data.frame(num) > ...READ MORE

## What is the difference between [] and [[]] notations to access the elements of a list or dataframe in R?

R provides 3 basic indexing operators. Refer ...READ MORE

## How to get the output of number of elements to reach a cumulative sum?

You can use the sapply function, to loop ...READ MORE

+1 vote

## Error saying "vector size cannot be NA" when using R with data mining

You can use the removesparseterm function.  Removes sparse ...READ MORE

+1 vote

## How to segment documents into phrases in text mining using R?

You can do this in R using ...READ MORE

## Trying to find frequent itemsets of a data set using arules package

Try replacing ID <- c("A123","A123","A123","A123","B456","B456","B456") item <- c("bread", "butter", "milk", ...READ MORE

+1 vote