Posts by André • 333 points
15 posts
-
0
votes2
answers299
viewsA: R how to extract the first value from a date list.
I wanted to extract the first value from each list. I solved the problem as follows: first created a matrix() with the desired size: pop_list <- matrix(nrow=length(df_desejado)) then rotate this…
-
0
votes2
answers299
viewsQ: R how to extract the first value from a date list.
I have this list of data:: base_list <- list(structure(list(POP_84 = 17.7, POP_92 = 18.8, POP_99 = 19.7, POP_02 = 20.5, POP_04 = 21.2, POP_09 = 23, POP_11 = 24.5), row.names = 149L, class =…
-
2
votes1
answer40
viewsQ: Apply function, extract regression data
I have the following sample: x <- structure(list(POP = structure(c(1L, 12L, 15L, 16L, 17L, 18L, 19L, 20L, 21L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 13L, 14L), .Label = c("pop1", "pop10",…
-
0
votes2
answers60
viewsA: R Regression by condition using apply or for
I managed to supplement the code to not give this error follows the solution of the function for: for(i in (lav)){ # loop por linha # indices de coluna com valores -Inf indice_com_inf <-…
-
0
votes2
answers60
viewsQ: R Regression by condition using apply or for
I have the following sample: x <- structure(list(POP = structure(c(1L, 12L, 15L, 16L, 17L, 18L, 19L, 20L, 21L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 13L, 14L), .Label = c("pop1", "pop10",…
-
0
votes1
answer46
viewsQ: r Loop by script condition
It is possible to loop from this data? library(dplyr) mes <- c("jan","fev","fev","mar","jan","nov","mar","mar","mar","jan","nov","maio","maio","maio","nov","nov","mar","jan","mar","jan") a <-…
-
2
votes1
answer371
views -
1
votes2
answers52
viewsQ: R regression on same line data
I have the following data: mes <- c("jan","fev","mar","abr","maio","jun","ago","set","out") a <- c(32.3,32.7,32.6,33.1,33.0,33.5,33.4,33.4,34.9) b <-…
-
5
votes1
answer204
viewsQ: R how to calculate on different lines of the date.
I’m doing it this way: temp <- data.frame(ano = c(1997,1999,2001,2003,2005,2007,2009,2013,2019)) a <- (temp[2,1]-temp[1,1])+1 b <- (temp[3,1]-temp[1,1])+1 c <- (temp[4,1]-temp[1,1])+1 d…
-
2
votes1
answer693
viewsQ: Subtitles by GGPLOT2
I have this graph created by the geom_bar function(): I would like to separate the two boxes where are plotted to Fill, as follows: How do I do this? which parameter of the Theme() function can I…
-
2
votes1
answer748
viewsQ: Bar graph name in ggplot2
I made this chart with geom_bar(), would like the title (a) followed the direction of ylab, but I’m not getting it. I used this function parameter geom_bar() theme(plot.title = element_text(hjust =…
-
2
votes1
answer146
viewsQ: Bar Graph in ggplo2, geom_bar()
I made this chart with geom_bar(), would like the bars to be glued to the bottom line, indicated by the arrows. How could you do? Have some function parameter theme() that can solve this problem?…
-
0
votes1
answer466
viewsQ: R histogram with all apparent breaks, hist() function
I have a database with over 8000 lines and would like to create a histogram, but it does not show the bar in all lower frequency classes, in the case of the last classes (Image). I understand that…
-
3
votes1
answer309
viewsQ: R Delete data frame lines by condition
I have the following data set: Nome <- c("Laetia","Vouacapoua","Lecythis","Pourouma","Poraqueiba","Pseudopiptadenia", "Abarema"); I1 <- c(1,3,3,2,3,3,3); I2 <- c(1,3,1,3,3,3,3); I3 <-…
-
1
votes1
answer446
viewsQ: R - Create Binary Variable (dummy) value 1 for 50% of the total
Well, I’d like some help, I have these data each column has 100%, first wanted to index from the largest to the smallest and later make use of the dummy variable of value equal to 1 for the species…