Posts by saulogr • 118 points
7 posts
-
1
votes1
answer69
viewsQ: Combine file . shp with a data frame
I read a file . shp with the package sf. map_recife = st_read("./shape/Bairros.shp", stringsAsFactors = FALSE) > glimpse(map_recife) Observations: 94 Variables: 11 $ CBAIRRCODI <dbl> 19,…
-
2
votes3
answers193
viewsA: Conditional formatting on line R
You can do the following: For each row identify which one is filled; Associate to the column N_VOLTAS the value of these columns. I’d do it this way: df <- data.frame(var1 = c(rep(NA, 5), 1, 1,…
-
4
votes2
answers2242
viewsA: Show Data Labels in Column Chart in R (ggplot2)
You can use both geom_text()Qunate geom_label(). See the example using geom_text(). First I will clear a dataframe to use as an example. library(ggplot2) vendas = data.frame(total =c(1150, 900, 850,…
-
0
votes2
answers186
viewsA: Calculating columns with conditional in R
One efficient way to handle these cases is with the function mutate(), of tydiverse. Follows the code: library(tidyverse) df = data.frame(Valor = c(100, 200, 300), DebCred = c("C", "D", "C")) df…
-
1
votes1
answer278
viewsA: View Table in Access Through R
I’ve had a problem like this and solved it by following the following procedure: Getting Access data into R Basically, you will need the package RODBC, which will allow you to access a variety of…
-
2
votes2
answers290
viewsA: Create a bar graph in ggplot2 with juxtaposed columns
Hello, the secret is what Marcus said, turn to Tidy format. I suggest the following bibliographies regarding: R for data Science; Tidy Data. I will also leave an additional way to make the…
-
0
votes1
answer41
viewsA: Regression with part of the base
If I understand you right, dataFrame as follows: > df categoria X Y 1 Fraco 118 30 2 Fraco 484 58 3 Fraco 664 87 4 Fraco 1004 115 5 Fraco 1231 120 6 Fraco 1372 142 7 Fraco 1582 145 8 Moderado 118…