Posts by Flavio Silva • 1,108 points
42 posts
-
1
votes1
answer36
viewsQ: Random Number Generator with Restrictions
I need to define randomly the weight of an investment portfolio that is divided into three types and cm the following limitations: Fixed income [0-100%] Variable Income [0-30%] Investment abroad…
-
1
votes1
answer64
viewsQ: Regex for numbers of different sizes
I need to read an image . png with a financial handling table, like the one below: From this table I need to extract the columns gross balance, availabilities, Application/Redemption and Final Gross…
-
0
votes1
answer305
viewsQ: Automate script execution R
There is a script in the R link that works perfectly in Rstudio. To automate it, it runs every Tuesday at 15:00, I decided to create a file. bat and schedule its execution by the task scheduler,…
-
2
votes1
answer45
viewsQ: Define limitation on generated random numbers
I need to create a random investment portfolio with certain benchmarks. I initialized it with all 0. structure(list(Benchmarks = structure(c(2L, 7L, 6L, 10L, 12L, 11L, 13L, 14L, 15L, 16L, 17L, 1L,…
-
1
votes3
answers426
viewsA: Select area escpecify in excel VBA spreadsheet
I used the following code planilhaB.Range("A1").Select planilhaB.Range(Selection, Selection.End(xlToRight)).Select Dim rng as range Dim rntLastColumn as range Set Rng =…
-
1
votes3
answers426
viewsQ: Select area escpecify in excel VBA spreadsheet
I have the table below in the photo, and would like to create a stacked area chart based on benchmarks (column values). I’m using the following code Private Sub CommandButton1_Click() Dim planilhaB…
-
2
votes3
answers63
viewsA: Date printed in wrong format
The answer was simpler than I imagined, it was enough to use a baseEstatistica[6,2] <- as.character(Sys.Date()) But the date came out in the format below: I updated the date code to the format…
-
1
votes3
answers63
viewsQ: Date printed in wrong format
I am developing an app in Shiny and I have a date printing problem, both in the browser and in the . csv file generated. She gets that shape: The code for obtaining the date is baseEstatistica[6,2]…
-
1
votes1
answer31
viewsA: Base Reading Step Bar
With the function withProgress package Shiny it generates a loading bar. It’s not exactly the way I wanted it, but it already satisfies by the hour. output$contents <- renderTable({…
-
1
votes1
answer31
viewsQ: Base Reading Step Bar
I am developing an app in Shiny that the user climbs a spreadsheet and is calculated some statistics from that base. I would like the moment the database is being read, not displayed in the upload,…
-
1
votes1
answer211
viewsA: Package installation "tabulizer" error in R
I had a little episode to install this package on my computer. First I updated my java. Then I had to install the package rJava. To install the tabulizer I went straight to R, without using the IDE…
ranswered Flavio Silva 1,108 -
1
votes0
answers27
viewsQ: Convert pdf to TIFF
I need to convert a pdf to an image .TIFF. I’m using the code below: library(pdftools) library(tiff) convertidoTIFF <- pdf_convert(pdfTeste, format = "tiff") length(convertidoTIFF) armaz <-…
-
2
votes1
answer29
viewsA: Generate subsequent month in R
Using the lubridate and dplyr packages: library(lubridate) library(dplyr) #Criando o data.frame cedido. A função dmy converte para o formato data df1 <- data.frame(dt = c(dmy("01/03/2018"),…
-
2
votes2
answers810
viewsQ: Convert all columns of a data frame
I know that to convert a column I can do df$COLUNA <- as.character(df$COLUNA). But my problem is that I need to convert all 80 columns of 18 arranged dataframes into one list. The idea of…
-
2
votes1
answer33
viewsQ: Reading Rdatas returning dates frames with different names
I need to read a list of 17 RDATAEach one of them returns one data.frame, but some of these data frames have different names (I don’t know exactly which ones) which would disrupt the code below…
rasked Flavio Silva 1,108 -
3
votes1
answer223
viewsQ: Widget in Shiny to take a file path
In an application here from work I use the widget below for the user to load a database and it is 'criticized' by another script. fileInput("file1", "Escolha o arquivo", multiple = FALSE, accept =…
-
4
votes1
answer1104
viewsQ: Run a file . R within another code in R
I have a code that reads the XML files that are in an enterprise network folder, and generates a file .RData. I have other codes that generate different reports for different sectors, using as a…
-
1
votes0
answers104
viewsQ: Rmarkdown with mixed accents
I wrote a report in Rmarkdown that, after a Windows update, it changed all accents by other characters. The main issue would be to read the external files. But there is a part that I need to read…
-
0
votes1
answer60
viewsQ: Function to go to a particular part of the code
There is some function in the R so that the given condition it jumps to a certain part of the code. I am implementing an audit model, but at certain points it needs external files that are sent only…
rasked Flavio Silva 1,108 -
1
votes2
answers82
viewsQ: Separate subsets of a base in R
I’m having trouble sorting out subsets of a particular database. On a given line he has the experience that indicates in which step that data belong, for example, the first line has the expression…
rasked Flavio Silva 1,108 -
5
votes1
answer310
viewsQ: Problems accessing a website via Rstudio
Problems when connecting there is a particular site via Rstudio url <- "https://www.jusbrasil.com.br/diarios/busca?q=%22licen%C3%A7a+sem+vencimentos%22&idtopico=T10001849&o=data" links…
-
2
votes1
answer549
viewsQ: Reading PDF in R
I am doing a job for college and would like to get the income and audience of each game of the Brazilian championship of recent years. CBF graduates into a series of links, an example is the…
-
1
votes1
answer155
viewsA: Problems with dates in R
Diego, I believe the code below does what you asked. I added a date conversion that you were not doing mutate(DATA = dmy_hm(DATA)) and also replacing the commas with dots mutate(KM_MED_DIA =…
-
4
votes1
answer524
viewsQ: Pdf reading via R
I need to convert the PDF data below into a data frame: http://www2.alerj.rj.gov.br/leideacesso/verArquivo.asp?idArquivo=635 Doing a search for found the How to Read PDF Data in R. I had some…
-
3
votes1
answer201
viewsQ: Truncation of values in R
I need to do a survey to detect how many employees currently earn equal to or above the INSS ceiling (R$ 5531.31, in the base reference month). The databases I have inform the contribution values of…
rasked Flavio Silva 1,108 -
2
votes1
answer2736
viewsA: Add rows and columns in R
Assuming Produção Tecnologica = CONTRATOS DE TECNOLOGIA + DESENHO NDUSTRIAL + PROGRAMA DE COMPUTADOR and Registros = INDICAÇÃO GEOGRÁFICA + MARCA + PATENTE. Using the basic R package just use the…
-
2
votes1
answer86
viewsQ: Negative age in R
I have a database that I need to calculate the age of the limbs in it, below a sample taken with the dput. base.teste <- c("04/03/73", "10/09/67", "21/12/74", "17/04/76", "25/03/66", "11/03/73",…
-
1
votes2
answers144
viewsA: separate columns and remove the letter t
The problem is that by setting the " t" as a function parameter R recognizes it as a tab symbol (the popular "Tab" on the keyboard) and therefore does not recognize its tab. However, when typing "…
-
1
votes1
answer805
viewsQ: Creation of graphical user interface in R
I wonder if there is a package that allows you to create a graphical user interface with buttons, text box and everything else. And how to generate a . exe from R code?
rasked Flavio Silva 1,108 -
5
votes3
answers1220
viewsA: Use of the sub function in R - string with special characters
You can change the encoding of the whole column at once dados$Col_Nova <- iconv(dados$Col_Velha, to = "latin1//TRANSLIT", from = "UTF-8")
-
7
votes1
answer398
viewsQ: Find the last day of the month
At the beginning of the month I always need to calculate the age of people within a certain database. I always consider the last date of that month, for example: in September I calculated the age…
-
1
votes1
answer1499
viewsA: I need to add captions to my chart in R
To increase the letters of the x and y axis is the function theme . It is worth remembering that the text is related to the text of the axis and the titlethe title of the axle. It is sufficient to…
-
2
votes2
answers130
viewsQ: Check if there are different elements in a list in R
I have a list that each element is one data frame containing various information on a particular pension institution. In the column CLASSE there can only be one type and I need to know who owns more…
-
2
votes2
answers416
viewsQ: Sort column of a data frame in R
I have a data frame with 89000 lines and in one column appears the degree of kinship with the employee. I need to divide into 4 classes, namely: Class 1 - Spouse/Children Class 2 - Mother/Father…
rasked Flavio Silva 1,108 -
0
votes2
answers1214
viewsA: Insert vector value of a data.frame into another data.frame
First I suggest transforming the name of the split column into Parc, to be the same in the two dataframes: names(coordg)[1] <- "parc" The function merge can help you. The code would look like…
ranswered Flavio Silva 1,108 -
2
votes2
answers1047
viewsQ: Presentation of disproportionate rmarkdown chart
Hello, I have the following problem: when I print the chart in Rmarkdown it gets the numbers one over the other, in addition to indicating the month/year in the coordinates also get the wrong view..…
-
2
votes1
answer1312
viewsQ: Graphic text position using ggplot2
I need to adjust the position of a text in the bar graph so that it is above the bar. Below the code used base.total %>% group_by(SEXO, REGIME.JURIDICO.FINAL)%>% count() %>% ggplot(.,…
-
6
votes1
answer1654
viewsQ: Text position on pie chart in ggplot2
I have the following table Var1 Freq Percentual Até 50 anos 4657 2.98% De 51 a 60 anos 32009 20.47% De 61 a 70 anos 57368 36.68% De 71 a 80 anos 46075 29.46% Mais de 80 anos 16299 10.42% And I need…
-
5
votes3
answers749
viewsQ: Add currency rating in R
I have the following problem here at work: in a data frame I have a column of Gross value at certain date: 2016-02-01 751434574 2016-03-01 748873781 2016-04-01 755528121 To work in the R without…
rasked Flavio Silva 1,108 -
3
votes0
answers592
viewsQ: Problem type Std::bad_alloc
I’m trying to read a database that’s in .xlsx. It has about 90,000 rows and 70 columns. I’m using the package openxlsx and I’ve made the mistake: Error in eval(substitute(expr), envir, enclos) :…
rasked Flavio Silva 1,108 -
1
votes1
answer111
viewsA: Fetch data from one data frame from the data in another
I already got the solution, it was through the merge function merge(pensionista.janeiro, pensionista.especial[,c("ID.FUNCIONAL","VL_BRUTO")], by.x = "ID.FUNCIONAL", by.y = "ID.FUNCIONAL", all.x =…
ranswered Flavio Silva 1,108 -
1
votes1
answer111
viewsQ: Fetch data from one data frame from the data in another
I’m on a quest I can’t solve. The problem is this: I have two tables and I need to research if there are equal people in the two tables, in case I need to see how much it earns in the second table…
rasked Flavio Silva 1,108