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...
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_...
I have the following database:
id x
1 2
1 3
2 3
3 3
3 3
3 3
I wanted to create a new database without repeating the value of the field id , to solve this I can average the values of field x tha...
I need to delay a variable from my db ( dCoopCred ). However, it can not mix the delay of two individuals (% with%). I would like CNPJ to be LAG_Result_ant_desp in t-1 (previous period).
Example:
structure(list(CNPJ = c(...
I want to filter my database based on two variables: via and city . This filter, however, is done by means of case particles present in these two variables. For example, I want to analyze who took the first route ( 1via ) and...
I have this dataframe and I need to organize it so that the unique dates are the first column and the columns are the shares of bovespa with their values being their respective prices:
df<-structure(list(data = structure(c(1L, 1L, 1L, 1L, 1...
I need to exclude empty df rows from a 30-year time series, with three daily measurements for each variable. I already used the subset(x, ...) function that solves part of the problem. However, in some cases there is no recorded measureme...
When calling the dplyr::n() function in the global environment, an error occurs.
n()
# Error: This function should not be called directly
This error makes sense and I was curious to see how it was implemented.
n
# function ()
# {
#...
I need to run a function that is in .GlobalEnv in a parallel processing using the multidplyr package.
Using a simple example and no parallel processing works as expected:
library(dplyr)
library(purrr)
library(multidplyr)
data.frame(x = 1:1...