Posts by Filipe Lauar • 361 points
10 posts
-
3
votes1
answer159
viewsA: Generate a calendar in R
To solve this problem you only need the function bizeq. This simplified code already solves your problem: library(bizdays) dias_uteis = bizseq("2020-01-01", "2021-01-01", "Brazil/ANBIMA") I googled…
-
1
votes2
answers70
viewsA: Loop for inside a list with a group argument function
The problem with is in x and in the g, you must replace the lt_1 for i: for (i in lt_1) { for (f in names(i[, 1:3])) { print(pairwise.t.test(x = i[, f], g = i[['y']], p.adj = 'bonferroni')) } }…
-
1
votes1
answer65
viewsA: What’s wrong with my K-Earest Neighbor code on R?
Your accuracy is giving 100% because the data from your test suite is present in the training suite. As the result of the KNN is measured by the distance between points, and its test set is present…
-
1
votes2
answers74
viewsA: Select dataframe information based on specific conditions
Look Phil, the code below solves your problem: '%ni%' <- Negate('%in%') cidades <- unique(dados$Municipio) for(cidade in cidades) { generos <- subset(dados$Genero, dados$Municipio ==…
-
4
votes1
answer55
viewsA: Merge date.frames into R
To join the 2 data.frames into rows you can use the function rbind.data.frame or only rbind. However, in your case it will give error saying that the data.frames have different column names. You…
ranswered Filipe Lauar 361 -
0
votes1
answer78
viewsA: Is there a way to use Natural Language Processing (NLP) to transform strings into integers?
I do not believe that NLP is used to solve this problem. The main uses of NLP are for text translation, text generation, caption generation for images... Currently, to solve these problems we use…
-
0
votes2
answers61
viewsA: Search for data frames by names in R
in which case you can include these data frames in a list and name it with the name you want, each index in the list will be a data frame. df1 <- data.frame(x = c(1:3), y = c(3:1), z = c(4:6))…
ranswered Filipe Lauar 361 -
2
votes4
answers101
viewsA: Dealing with dates of heterogeneous formats in R
You can check the date format using the substr and transform function to the right format, the code below solves the problem for vector x: x <- c("2019-10-08 10:15:00", "01/08/2001 21:56") x…
-
2
votes3
answers174
viewsA: A: Column average over the range of values in R
Good afternoon, whenever you want to mess with the data frame, use the function subset(dataframe, condições). In the first argument you include the dataframe you want to return, it can be whole or…
ranswered Filipe Lauar 361 -
6
votes1
answer103
viewsA: Access data.frame information in R
Use the function subset(seuDataFrame, seuDataFrame$colunaID == valorID), it will return the line corresponding to the ID you want.
ranswered Filipe Lauar 361