Posts by Italo Cegatta • 353 points
8 posts
-
4
votes1
answer241
viewsQ: Draw lines from a specific point and angle
I’m looking for a way to draw a line from a point and an angulation (azimuth) and then construct a polygon with the intersection of these lines. base <- tibble::data_frame( id = c(1, 2, 3), x =…
-
5
votes1
answer2251
viewsA: Bar graph with percentages - ggplot2
This part of frequency is kind of hard to do by ggplot2 straight. I prefer to do the counting before and then just plot. library(tidyverse) dados <- data_frame( v1 =…
-
2
votes1
answer531
viewsA: POST request with httr not complete (Fipe table site)
For each type of query there is a Request url. In the case of the complete consultation is: url <- "http://veiculos.fipe.org.br/api/veiculos/ConsultarValorComTodosParametros" The form for this…
-
2
votes1
answer531
viewsQ: POST request with httr not complete (Fipe table site)
I’m trying to get the price data from the FIPE table automatically. Structurally, the information stays at this location: library(httr) library(rvest) url <- "http://veiculos.fipe.org.br/"…
-
2
votes1
answer134
viewsA: In R, use dplyr functions to find the minimum distance
I tried to do something similar a while ago. I did it the way it is below, it was the best I could. library(dplyr) library(tibble) library(tidyr) pontos_sub <- tribble( ~id, ~lat, ~long, ~long_r,…
-
2
votes1
answer163
viewsA: Using If/Else in R
The first big question is to organize your data in the right way. I recommend reading the tidydata-related materials in R(here and here). There are columns with repeated names in their database, I…
ranswered Italo Cegatta 353 -
3
votes1
answer64
viewsQ: perform . Globalenv function in parallel processing
I need to execute a function that is in . Globalenv in a parallel processing using the multidplyr package. Using a simple example without parallel processing, it works as expected: library(dplyr)…
-
2
votes2
answers1477
viewsA: Plot Graph Multiple Variable Bars in R
An alternative to @Molx’s response, but following the concept tidy data. library(dplyr) library(tidyr) library(ggplot2) dados <- replicate(5, sample(1:10, 5, TRUE)) colnames(dados) <-…
ranswered Italo Cegatta 353