I have a data frame.
I am trying to use the tapply function to find the average of one column when the values of a second column are equal to a given...

2 years ago
I am trying to do an exercise to become more familiar with how to use the map function in purrr. I am creating some random data (10 columns of 10 data...

2 years ago
I get two vectors as output from R analysis, respectively>
[1] "216" "217" "218" "219" "220" "221" "222" "223" "224" "225" "226"
[1] 10014733 10014...

2 years ago
I have a string of variable names and I want to extract the currencies as given by a vector from that. But I am having difficulties extracting the val...

2 years ago
I have a column of dates as follows,
> mymonth = c('10/2015','11/2016','12/2016')
> data <- data_frame(mymonth)
> data
# A tibble: 3 × 1
...

2 years ago
Example
Problem statement
Solution search and
Question
... see rmarkdown example code.
Appreciate answers demonstrating the solution by modify...

2 years ago
I'm creating a facetted plot to view predicted vs. actual values side by side with a plot of predicted value vs. residuals. I'll be using shiny to he...

2 years ago
I have two vectors x and y. I would like to find which elements of x are between the two elements of vector y. How can I do it in R?
x = c( .2, .4, 2...

2 years ago
I have the following dataset:
Names Category
Jack 1
Jack 1
Jack 1
Tom 0
Tom 0
Sara 0
Sara 0
what I am looking for is the f...

2 years ago
Suppose I have a data.table:
x <- data.table(x=runif(3), group=factor(c('a','b','a'), levels=c('a','b','c')))
I want to know how many rows in x ...

2 years ago
In R I am looking to set the selection of the output for a gvisTable so that a specific row or column is highlighted.
For example I have the followin...

2 years ago
I am using the multinomial distribution from the gbm package in R. When I use the predict function, I get a series of values:
5.086328 -4.738346 -8...

2 years ago
Example
string <- "field1,field2,\"there is a , in field3\", field4, \"2,456\", field6"
A negative attempt:
test <- unlist(strsplit(noquote(...

2 years ago
I have columns in R dataframe as
StreetName BeginTime
wls-wilkeson17-45 2016-11-26 20:04:33
wls-wilke...

2 years ago
I am trying to calculate the Gaussian kernel density, and to test of my knowledge of the density() function, I decided to calculate it from scratch an...

2 years ago
I have a dataset of repeated measurements over days for variables t, l and c. I am trying to calculate the difference in days between the peaks for t,...

2 years ago
I have two matrices that i want to sum
mat1<-matrix(1:4,2,2)
mat2<-matrix(5:8,2,2)
mat1
[,1] [,2]
[1,] 1 3
[2,] 2 4
mat2
...

2 years ago
I have this data.table with different column types.
I do not know the column names before hand and I would like to generate aggregations only for co...

2 years ago
I am doing the following steps to install R Hash_2.2.6.zip package on to Azure ML
Upload the .zip file as a dataset
Create a new experiment and Add ...

2 years ago
This question is slightly similar to this question with a more theoretical component.
Given df below:
varA <- c(1,0,0,NA,NA)
varB <- c(NA,NA,N...

2 years ago