Questions tagged as 'r'

2
answers

R - IBGE municipal data download

Is there any way to download IBGE municipal data with the R command line?     
asked by 10.07.2014 / 00:17
2
answers

How to execute the tapply function for multiple dataframes in R?

I want to execute only ONE tapply function and get results for each of the dataframes at one time: dataset1<-data.frame(group = rep(c('a','b','c','d'), 3, each = 3), number1 = c(1:36), number2 = c(1:36)) dataset...
asked by 18.08.2018 / 04:28
2
answers

Convert a list with dataframes of different rows into independent dataframes [R]

I have a list of 3 dataframes, which are derived from the split function: > split $'1' bin group1 group2 missing score1 score2 gender size score3 income city 0 1 1 NA 3 2 M S 4 1605....
asked by 21.08.2018 / 03:35
1
answer

How to generate random values for a known distribution?

I am aware that, for example, runif(1000,0,3) generates 1000 random values for a uniform distribution for x between 0 and 3. But how to do this for any probability density function? Any clue is grateful!     
asked by 09.12.2015 / 22:03
2
answers

Sort the highest k results using dplyr

I can select the largest k results of a table in R. For example, if k equals 5, I get the following result: library(dplyr) library(ggplot2) top_n(mpg, 5, wt=displ) # A tibble: 5 × 11 manufacturer model displ year cyl tr...
asked by 08.12.2016 / 22:23
1
answer

Catch the previous value with a condition in R

I have a base with a unique key made up of two other repeating variables, CNPJ and date. I need to make some sum and split accounts with the previous date values for each CNPJ. If there is no previous date value for each CNPJ it should return em...
asked by 14.02.2017 / 12:44
2
answers

How to rename the database (RData) in R?

I have the following situation: I need to merge two banks. The name of both bank files are: banco2.RData and banco2_2.rdata However, when I open the banks in R they have the same name: banco2 , in fact they do not even ope...
asked by 06.03.2017 / 18:59
1
answer

How to read PDF data in R?

I have numerous PDF files containing CPRM water wells , like this: link Within these files are information on the soil lithology of each well, as can be seen in the image below. The lithology table is on the second sheet of t...
asked by 23.09.2015 / 01:37
1
answer

Extract dataframes from lists with dataframes under certain criteria in R

I've organized my list of dataframes like this: df.1<-as.data.frame(matrix(rnorm(10),10,80)) df.1.in.list<-split.default(df.1, gl(10, 8)) In the df.1.in.list list I would like to keep the dataframes where the first element of column...
asked by 25.09.2018 / 23:43
1
answer

What are columns-list of a data.frame?

tidyverse encourages the use of list-columns in < a data / data / data.frames "class=" post-tag "title=" show questions tagged 'data.frames' "> data.frames . But, after all, What are columns-lists? On what occasions are they commonly...
asked by 26.12.2018 / 14:31