Posts by Bruno Avila • 867 points
28 posts
-
2
votes2
answers59
viewsQ: Chi-Square calculation for proportions
I have a DF with death proportions in population A and B. I want to do the test to verify the independence of the populations. Follow my DF: DATE<-…
rasked Bruno Avila 867 -
2
votes1
answer630
viewsQ: Do Not Remove Specific Data Frame
I’m working with several DF (more than 30), but I want to exclude all except one specific. Example of my DF: DF1 VCBGF2 FGFR3 BBTYI4 QQASX5 RRTPS6 DF7 TTIPMBBT8 DF9 DF10 So I want to exclude 9 DF's,…
rasked Bruno Avila 867 -
0
votes1
answer108
viewsQ: Transform XML into Dataframe
I have an XML and I’m trying to turn it into a DF. My XML: <?xml version="1.0" encoding="ISO-8859-1" ?> <test:TASS xmlns="http://www.vvv.com/schemas"…
-
0
votes1
answer73
viewsQ: Create column names with spaces
I’m trying to create a DF with columns that contain spaces in their names, but an error is appearing. This is the DF I’m trying to create: MUNICIPIO <- c('BELO HORIZONTE','BRASILIA','JUIZ DE…
rasked Bruno Avila 867 -
1
votes1
answer53
viewsQ: Consult Multiple Columns in R
I have a DF and would like to consult multiple columns at the same time in an Auxiliary Table. Example of DF: MATRICULA <- c(123,456,789,111,222,333) DIA_1 <-…
-
0
votes1
answer278
viewsQ: View Table in Access Through R
My machine is 64 bit, I would like to know how to connect R to a table in Access (2016). As an example to facilitate, suppose the table in Access is called MAT and the Access file is in a folder in…
-
0
votes0
answers61
viewsQ: Package: sp error starting Rstudio
When starting Rstudio the following message appears: Loading required package: sp. I try to install the package sp and the message appears: Warning in install.packages : package ‘sp’ is in use and…
-
2
votes2
answers94
viewsQ: Select Time in R
I have the following df with date in date and time format: MATRICULA <- c('111','222','333','444','555') DATA_INICIO <- c('17/03/2017 22:25','15/01/2019 20:01', '10/12/2013 01:01','10/10/2018…
rasked Bruno Avila 867 -
1
votes0
answers36
viewsQ: Exchange map results using leaflet and state_popup
I have a database of medical appointments by city. I use the leaflet and state_popup function to display the results on a map, as described below: pal <- colorBin("Blues",domain =…
-
3
votes0
answers169
viewsQ: How to change the title, caption, filter and export the Map in pdf using leaflet in R?
I created a map of MG to identify the Qtde of consultations by mining municipality. I got the code below on the internet and it worked. But I would like to add some more information, but I’m not…
-
4
votes3
answers488
viewsQ: Calculation of Difference between Dates
I have the following DF: MATRICULA <- c('111','222','333','444','555') DATA_INICIO <- c('10/12/2017','31/12/2014', '30/06/2015','20/11/2016','01/04/2014') DATA_FIM <- c('10/12/2017',…
rasked Bruno Avila 867 -
6
votes3
answers158
viewsQ: Minor Date in a Dataset
I have a data set and would like to select only the smallest date among each primary key (column MATRICULA). Follow the example of my DF: MATRICULA <- c(1,1,3,3,3,4,5,5,5,5,6) DATA <-…
rasked Bruno Avila 867 -
3
votes1
answer182
viewsQ: Lower Value of a Set of Columns
I have a set of data and would like to select only the smallest value among each primary key. Follow the example of my DF: ORDEM <- c(1,5,2,3,1,10) GUIA <-…
-
3
votes2
answers94
viewsQ: Different Records
I have two tables: MATRICULA_A <-c(123,234,345,456) dados_1 <- data.frame(MATRICULA_A) MATRICULA_A <-c(345,456,111,222,333,444) dados_2 <- data.frame(MATRICULA_A) I need to extract only…
-
6
votes3
answers1376
viewsQ: Fill column of a data frame with data from another data frame in R
I have the following df (data1): ITEM CLASSIFICACAO 123 AZUL 456 AMARELO 789 234 VERDE 345 PRETO 456 567 678 ROSA I need to fill in the blank lines of the column CLASSIFICACAO using another data…
-
2
votes1
answer126
viewsQ: Replace NA with data from another column
I would like to replace NA by the content of another column. I have the following data: NOME TIPO VALOR ABC INTERNACAO 10 ADD 20 AFF CONSULTA 30 DDD EXAME 40 RTF 50 DRGG EXAME 60 How would you…
-
3
votes2
answers1529
viewsQ: Remove NA in a Data Frame
I import file containing more than 30 columns. A few blank rows that I imported the R recognizes as "NA". When exporting these same columns, the rows that should be blank (empty) appear with "NA".…
-
7
votes1
answer1340
viewsQ: Calculate Time Difference in R
I have two dates in date and time format. Data1 <- 20/01/2018 20:33:58 Data2 <- 21/01/2018 20:23:48 The difference in hours is 23:49:50. How is the calculation of this difference in R? Also, I…
rasked Bruno Avila 867 -
2
votes3
answers407
viewsQ: Delete "X" in Header in R
I am importing a csv file into the R and the name of each column is appearing the letter "X" before the original name. For example: Field names in csv: 1.2_cidade; 2_UF. Field names after import:…
rasked Bruno Avila 867 -
3
votes1
answer181
viewsQ: Multiple join on R
I have two tables: dados and dados_aux. I need to add to the table dados the column REGIÃO, present in the table dados_aux. However, I have to use two keys to make the Join: CIDADE and UF.…
-
2
votes2
answers79
viewsQ: Join for unequal records in R
I have two data frames called employees and employees. nome.empregado <- c('Renato', 'Miguel', 'Paulo', 'Patrícia', 'Inês', 'Saulo', 'Diego', 'Maria', 'Jose', 'Julia', 'Tiago') idade <- c(30,…
-
5
votes2
answers331
viewsQ: Filter Different texts at different positions in R
Good afternoon. I have the following data: NOME <- c("MARIA 1001", "MARIA 1002A", "JOSE 1003B", "PEDRO 1003", "CARLOS 1019J", “ANTONIO 50”, “MARIA 80”) VALOR <- c(10, 20, 30, 40, 50, 60, 70)…
-
3
votes2
answers530
viewsQ: Filter Different Texts in R
Good afternoon, I have the following data: NOME <- c("LEITO 1001", "LEITO 1002", "LEITO 1003", "LEITO 50", "LEITO 60") VALOR <- c(10, 20, 30, 40, 50) dados <- data.frame(NOME, VALOR) I need…
-
0
votes0
answers68
viewsQ: Aggregate function in R
Good afternoon. I am using the function aggregate to group some data. However, I am only using one variable to add up. I would like to use more than one variable. Is this possible? I am using the…
-
4
votes3
answers3012
viewsQ: Aggregate function on R
Good afternoon. I’m using the function aggregate to group some data. However, I am only using one variable to add up. I would like to use more than one variable. Is this possible? I am using the…
-
4
votes3
answers5016
viewsQ: Replace NA in R language
I would like to replace NA (Missing) for a word. I have the following data: structure(list(NOME = c("ABC", "ADD", "AFF", "DDD", "RTF", "DRGG" ), TIPO = c("INTERNACAO", "", "CONSULTA", "EXAME", "",…
rasked Bruno Avila 867 -
1
votes1
answer1848
viewsQ: Select part of Text in R
I would like to filter specific elements of a line, similar to the Excel filter. I have the following example: NOME VALOR LEITO 1 10 LEITO 2 - HPP 20 LEITO 3 - HPP 30 LEITO 4 40 I need to filter, in…
-
1
votes3
answers5361
viewsQ: Tell Distinguished in R
I would like a help to build a distinct (distinct) count of a data frame. Follow the data: Filial Matrícula Valor ABC 100 R$ 500,00 XYZ 200 R$ 850,00 XYZ 100 R$ 320,00 JCT 300 R$ 512,00 JCT 300 R$…
rasked Bruno Avila 867