Questions tagged as 'r'

2
answers

Compare rows between rows between two data frames?

Considering: q1 <- data.frame(COD = 1:5, CLAS=letters[1:5]) q2 <- data.frame(COD = c(25,1,31,3,2), CLAS=c(45,letters[1],100,letters[3],letters[10])) I need to know which lines are common between the data frames, taking into account th...
asked by 08.08.2016 / 22:57
1
answer

Graphic package faster than ggplot2 [closed]

Do you know of any packages in R that concatenate and make 2D and 3D graphics faster than ggplot2?     
asked by 19.04.2016 / 18:23
3
answers

Remove elements from dataset by factors

Given a dataset : set.seed(1) fatores = sample(1:12, 30, replace = T) x = matrix(rnorm(60), ncol = 2) dataset = cbind(fatores, x) dataset = data.frame(dataset) dataset$fatores = as.factor(dataset$fatores) I want to remove rows whose number...
asked by 09.05.2016 / 16:23
1
answer

Plotting Graphics ggplot within loop

I'm trying to create a for using ggplot: Carteira<-cbind(A, B, C,D,E,F) A, B, C, D, E, F are data in the "zoo" format. My code is: for(i in 1:6){ ggplot(Carteira[,i], aes(Carteira[,i])) + geom_histogram(aes(y =..density..),...
asked by 13.09.2015 / 00:13
2
answers

Majority matrix vote in R

I want to compare elements of an array, for example, in line 1 (fixed) I want to know which object happens most frequently and return the same, I need it automated, because the number of columns is variable. Here is an example of the code: M...
asked by 04.09.2015 / 15:08
2
answers

Indicator in R conditioned to variables with duplicate values

Suppose there is a base with two variables as follows: Município IF RIOBOM Cooperativa RIOBOM Cooperativa ABADIA Múltiplo ABADIA Múltiplo ABADIA Cooperativa ABADIA Banco DOURADOS Banco DOURADOS Múltiplo DOURADOS Banco DOURADOS...
asked by 17.11.2017 / 14:44
2
answers

Create a calendar dimension with the month prior to Sys.date

Hello, the script below creates a CSV with a Calendar dimension from year 2015 to the current month. I happen to want the function to return the month before execution. Ex: If Sys.Data records 14/11/2017, it returns the date 10-14-2017. Or, if p...
asked by 14.11.2017 / 19:54
2
answers

In R, sort a date frame by one column and by groups

I want to sort a date frame according to a v2 column and respecting the groups column. For example, suppose I have df as follows df v1 v2 grupo 1 5 1 4 1 1 1 2 1 5 7 2 4 2 2 1 9 2 I want the result to be df v1 v2 g...
asked by 26.04.2015 / 22:11
2
answers

In R, Using dplyr, create a new array

Suppose I have the following database >data zona candidato votos 1 A 100 1 B 20 2 A 30 2 B 15 I want, using dplry, the following array >nova zona votos_...
asked by 13.10.2014 / 23:11
1
answer

How to concatenate two strings?

Assuming I have two strings, Olá  and mundo! , how do I concatenate them using R?     
asked by 10.09.2016 / 16:34