Questions tagged as 'r'

2
answers

LaTex and Python integration or R [closed]

Hello, I have a project that involves automating reports. Currently all reports are made through word and graphics in excel, now I'm trying to deploy an application that automatically generates the graphics in linguagem R and I wanted the...
asked by 12.03.2018 / 19:07
1
answer

How to create a column in R under specific conditions?

Consider the following data.frame: data <- data.frame(x=c("a","b","c","d"), y=c(2,2,1,2),w=c(4,4,2,2),z=c(25,16,24,30), k=c("sim","nao","sim","nao")) How to include a new column where we will have value 1 for the lines with y = 2, w = 4...
asked by 14.11.2017 / 23:14
2
answers

What does the expression mean (...)?

I could not figure out what the expression !(...) means Example: if (!(book %in% books)) stop("Unknown book")     
asked by 09.04.2018 / 22:30
2
answers

Compare vector elements in R, of different size

My intention here is to find the elements in common between a and b. a <- seq(from=1, to=5, by=1) b <- seq(from=5, to=13, by=1) x <- which(a==b) Warning message: In a == b : longer object length is not a multiple of shorter object le...
asked by 24.03.2017 / 18:21
2
answers

Chaining - R

I have two date frames, one containing product data and one containing store data, but I do not have reference variables between them (which would not allow me an inner join), my need is to present for each of these products in question the code...
asked by 07.08.2017 / 15:08
1
answer

Is there a function in R that helps me find the fashions of a multimodal dataset?

Something of the type EncontraModa (Dataset, N_Mores_Modas)? I'm working with the following integers:     c (1,2,3,4,5,6,7,7,7,8,8,9,9,9,9,9) That is, the example is trimodal and has a larger fashion than the other two. The ideal would b...
asked by 09.02.2018 / 21:03
1
answer

How to calculate the difference between two dates of a column and group by category to generate a new Database in software R

Following the example of the original database and the new database:     
asked by 29.04.2018 / 16:13
2
answers

Loop to calculate the maximum value

I need to calculate the maximum consumption value based on the previous values every time I loop the consumption data. For example on day 4, the maximum consumption would be calculated from day 1 to 4. Follow the code I thought, but I do not...
asked by 24.10.2017 / 17:29
2
answers

Reproduce graph of ggplot2 using multiple facets

I built the chart below using the grid.arrange command of the gridExtra package, I would like to leave it with the visuals of the multi-faceted graphs, using the sample size as a facet, is it possible? library(ggplot2) library(gr...
asked by 21.04.2017 / 03:59
1
answer

How to separate text responses in R?

I'm sure my doubt should be super simple to be solved so far I have not had any positive results in any of the tutorials I've accessed. I'm working on a df in the R there is a column that the answers were separated by; that is, each participa...
asked by 15.10.2018 / 22:01