Posts by Flavio Barros • 1,717 points
41 posts
-
0
votes1
answer29
viewsA: Problems with predictions using Predict.Gam() and geom_smooth(method="Gam")
See, the answer to your question is in the documentation of geom_smooth(): For method = NULL the Smoothing method is Chosen based on the size of the largest group (Across all panels). Stats::loess()…
-
6
votes2
answers349
viewsA: Import csv - 18 million lines in R
This is a job for the reader! With readr you can read lines and it automatically detects the type of variables. See an example: library(readr) sc <- read_csv2(file =…
-
2
votes1
answer261
viewsA: How do you put three time series into one?
I don’t know how exactly your series is in the file cimento.csv. The ideal would be for you to provide a time series exactly as yours is. However I believe that the problem to join time series can…
-
1
votes1
answer58
viewsA: Caption in matplot command
You can create a caption quickly with the command legend. I made a little caption for the example you quoted: a = rnorm(1000) b = runif(1000) matplot(cbind(a, b), type = 'l', ylim=c(-5,5), main =…
ranswered Flavio Barros 1,717 -
2
votes1
answer126
viewsA: Bar graph - Manual grouping of data
In the ggplot2 for you to define the category in which bar charts will be made you need to provide a categorical variable. You can create this categorical variable manually using the command cut and…
-
1
votes1
answer436
viewsA: R, Shiny and maps: How to render a map according to the choice in the dropdown_menu?
INTRODUCTION Initially I would like to point out that by the code of your app and the problems that existed in it I believe that you are probably starting to use the Shiny. I will then present the…
-
3
votes1
answer290
viewsA: Grouping of data - Histogram R
This question is not trivial but it is important because it had never appeared here. What do you want exactly is to make a Plot by controlling yourself the width of the Bins. The geom_histogram has…
-
5
votes1
answer278
viewsA: In R, how to find out if two vertices are adjacent from an adjacency matrix
Well, your question is a little better but for your example to be really reproducible you should provide the matrix in a ready format for R, so that whoever answered it would only need to copy and…
-
2
votes1
answer241
viewsA: How to update a dataframe column in R using joins without creating another object?
The ideal is to provide a reproducible example so that whoever answers can simulate what you have already tried. As you’re just arriving in the O.R., I’ll do it for you: CREATING A REPRODUCIBLE…
-
1
votes2
answers550
viewsA: How to count sequence numbers in R?
My dear, see the recommendations in the comment as they are very important to ensure the quality of the questions and answers. As you are arriving here in the OS I will give a discount and I will…
-
2
votes2
answers1868
viewsA: How to position the title in ggplot2 with theme_ipsum?
I will suggest that you do not use the pie chart in general. I know your question is specifically about pizza graphics but it is important to point out how there are much better options. What is the…
-
2
votes2
answers104
viewsA: Approximate graphics
I don’t know if this solution I’m going to suggest to you is exactly the solution to your problem. The way you exposed the problem the idea would be to approximate the graphics made with R Base.…
ranswered Flavio Barros 1,717 -
2
votes1
answer581
viewsA: How to add lines in a data.frame and or table in shinyserver?
INTRODUCTION I will present the solution of the problem using the reactValues. Meanwhile read the considerations I will make about this solution right away. SOLUTION The solution is this: create an…
-
1
votes2
answers153
viewsA: How to delete and then create all variable names in a data.frame in R?
Actually the solution is quite simple: you do not need to delete the names. Every time you update the data.frame just update also what are the columns. EXAMPLE I will create an example data.frame…
ranswered Flavio Barros 1,717 -
0
votes1
answer87
viewsA: Simultaneous threading (parallel processing) in R and serialized recording in Sqlite
My dear @Georgesantiago your problem is insoluble, unfortunately. This is due to the implementation of Sqlite. Sqlite is not a database management system that allows multiple processes to write at…
-
5
votes1
answer133
viewsA: Problems with xml to transform into data.frame in R
It is very rare for you to find an XML that is already in the right structure to turn it into a data.frame. Ideally you turn the file into a list and then extract from the list what you need.…
-
3
votes1
answer94
viewsA: How to omit Chunks in Rmarkdown?
I’m already going to make a caveat initially that this is not such a suitable issue for stackoverflow. Just search the documentation you would find. But anyway, they follow the shortcuts: - Folding:…
-
0
votes0
answers63
viewsQ: How to create a great reproducible example in R?
I already made one question previously on how to produce reproducible examples for questions involving the Shiny. Here at Stackoverflow in English there is guides and also questions whose theme are…
rasked Flavio Barros 1,717 -
0
votes1
answer323
viewsA: SVM model - regularisation and cost factors
Parameter C is the penalty associated to instances that are either misclassified or violate the maximal margin. What the SVM algorithm basically does is to find the largest margins for linearly…
ranswered Flavio Barros 1,717 -
13
votes1
answer323
viewsQ: How to convert a Shiny app, consisting of multiple files, into a playable example that can be shared in a question?
Problem Here at Stackoverflow in English there is guides and also questions whose theme are the reproducible examples. However there is nothing equivalent to the Shiny what can make life difficult…
-
0
votes1
answer202
viewsA: Insert data into Bigquery daily
This question is very broad, it is not reproducible, BUT I will provide my 2 cents. There is a cloud service called Stitchdata which basically integrates data sources with a data Warehouse like…
googleanswered Flavio Barros 1,717 -
1
votes1
answer259
viewsA: How to handle errors during web scraping?
To solve this problem, and other similar, you need to do script error handling. There are basically two ways to do this: 1. tryCatch 2. purrr package USING THE tryCatch This is an example of my own…
-
-1
votes1
answer39
viewsQ: Error with Django-blog-Zinnia users model
I created a project from scratch with the cookiecutter-Django, using version 1.9.9, since in documentation of the Django-blog-Zinnia package it is recommended to use Django < 2.0. To use version…
-
1
votes1
answer158
viewsA: How to Insert selectInput across the datatable
Initially I would like to point out that the example you put forth generates a datatable STATIC. So, even if you were able to replace yours with a type of HTML entry, whether it’s a button or a list…
-
1
votes1
answer483
viewsA: Problems loading the Rcmdr
When installing a package you can ask R to urge the dependencies together. For example: install.packages('Rcmdr', dependencies = TRUE) should solve the problem.…
ranswered Flavio Barros 1,717 -
5
votes1
answer107
viewsA: How to calculate the difference between two dates in a column and group by category to generate a new database in R software
Initially I would like to point out that the ideal is always to ask questions with reproducible examples. In your case you should have provided the date.frame dice that I ended up having to type…
ranswered Flavio Barros 1,717 -
5
votes4
answers5814
viewsA: How to read microdata from ENEM in R?
Concepts They’ve been great so far, but I’m gonna add my two cents here. I would say that when we are working with data sets that are well over the size of RAM, for me, the ideal is to always work…
-
14
votes4
answers5814
viewsQ: How to read microdata from ENEM in R?
The INEP (Instituto Nacional de Estudos e Pesquisas Educacionais Anísio Teixeira) makes available for download the microdata of ENEM (and others) from this link. These microdata are the ENEM’s raw…
-
1
votes1
answer2018
viewsA: How to transform numeric variables into strings in R (0=NO and 1=YES)?
I would suggest closing the question, but how can it be useful for other users I will put here two useful knowledge that would solve the problem and present an important concept about the use of R.…
-
2
votes1
answer195
viewsA: Automatically insert graphics into github pages
There is a very easy way to do this: put the codes of the figures (in R) in a rmarkdown (Rmd) and Compile file for the Github markdown format. Just to give you an example, let’s create a rstudio…
-
3
votes2
answers361
viewsA: How to Create a Bubble Plot
Look, the ideal is to provide together with the question at least some sample data set. But I’ll give you an example here, similar to yours, using ggplot2: ## Dados de exemplo dados = data.frame(x =…
-
1
votes2
answers108
viewsA: Updating Mysql table using sqlSave in R
Once in a job I needed to add tables in a database incrementally. The solution I used was this one: ## Cria uma conexão com o banco de dados con <- dbConnect(drv, user="usuario_do_banco",…
-
4
votes3
answers1955
viewsA: Pre-process large text files in R
Very good solution @Carloscinelli. But an alternative solution is using the package Iterators. The change_dot() function basically reads a line, swaps the ',' for the '.' and writes the line in a…
-
4
votes1
answer330
viewsA: Classify a text array using regular expressions using R
@Juliotrecenti, there is a way: to include the logical tests in Regex. Note that the pipe (|) is the equivalent of an OR operation, but to implement the AND operation we will need the Lookahead.…
-
6
votes1
answer321
viewsA: Best SQL DBMS for with large bases (RAIS > Mem RAM)
The choice of DBMS depends on what you will do with the data and the type of data that will be used. I will mention what are, in my opinion, the advantages and disadvantages of using the following…
-
20
votes4
answers5405
viewsA: Strategies to analyze very large databases in R (that do not fit in RAM)
This question depends on some factors such as the task of analysis that one wishes to perform and the size of the data set, that is, how big it is in relation to the RAM (and sometimes the hard…
-
3
votes4
answers8289
viewsA: How to put different graphics of ggplot2, separately but on the same screen?
Well, if it is to put all the SEPARATE graphics on the same screen, this is possible with the gridExtra package. However, depending on the situation, there is the feature of facets or also put all…
-
3
votes2
answers2111
viewsA: I can’t install Ibgepesq in R to read the Pnads
I know Damico’s scripts, but personally I prefer the solution I’m going to present here. Because the PNAD data is provided as microdata, it is sufficient to have the research dictionary that the…
-
0
votes2
answers4318
viewsA: How to save or reserve a list of objects? (R)
Vasco if I’m not wrong you have a typical task in which the most elegant solution is a split. The solution I’m going to present to you is for when you want to separate a data set relative to the…
-
2
votes3
answers530
viewsA: How to select all data.frame variables at once for a regression?
The point is particularly useful when you want to put interaction effects. For example, suppose you want to test a model with all variables and all interactions of up to 2 variables, as could be…
-
7
votes2
answers441
viewsA: How to make a "rbind" in tables of an SQL base from R?
Let me add my 2 cents: Carlos' solution is correct, BUT in this solution you will copy each entry of the two tables into a new table and they will no longer be related, that is, any changes in the…