Most voted "r" questions
R is an open-source environment and programming language for statistical computing, bioinformatics, and graphics. It is advisable to supplement your question with a minimum reproducible example.
Learn more…2,359 questions
Sort by count of
-
1
votes0
answers33
viewsWeb Scraping with R - static table
I would like to consolidate the data of a betting site in a database on R. I’m trying it the way below, but my script doesn’t recognize the columns and rows of the table in fact, only the layout:…
-
1
votes1
answer54
viewsHow to find larger increasing or decreasing subsequence in a vector?
I have the following vector: a <- c(1,2,3,1,1,2,3,4,2,5,6,7,8,4,6,4,3,2,1) I would like to find the largest increasing and decreasing subsequence of it. The output would be the indices of the…
-
1
votes1
answer53
views -
1
votes1
answer45
viewsMark the highest and lowest value of a column with kableExtra in R
I am building a report in Rmarkdown and need to create a table with the data table below: MEDIA <- data.frame(Questões = c("Questão 43", "Questão 44", "Questão 45", "Questão 46", "Questão 52",…
-
1
votes1
answer55
viewsColoring map with ggplot_2
Vi that question here in the so and tried to reproduce to my situation, however, still I did not get the desired result. library(tidyverse) library(geobr) library(RColorBrewer) Below the map of…
-
1
votes1
answer37
viewslooping with dplyr in R
I’ve been looking for a solution to a question for days. I intend to create a repeating structure that allows to save a table for each class according to the code below, filtering and saving…
-
1
votes2
answers78
viewsTables type GT not printing inside loop in Rmarkdown
I’m programming a report generator that exports html. I use two files, the first is a loop that will determine the number of reports and within my template. Rmd I have another loop to print several…
-
1
votes3
answers44
viewsHow to index subgroups in R
What I need is to index subgroups within a group and that R brings me a specific result, line by line, depending on the subgroup. First I need to group the data by process. This I got with group_by:…
rasked 3 years, 6 months ago Rodrigo Gregorio 21 -
1
votes1
answer46
viewsLogical condition on a dataframe
After finding a value of a calculation I need to compare if this value is equal to any of the first column of the table below (percentile), if it is equal, the corresponding value will be selected…
rasked 3 years, 5 months ago Josiane Souza 102 -
1
votes2
answers43
viewsLeft_join returning dataframe with more lines than the original
I have a date.frame with IBGE census data and a column called IND and I have another date.frame with a column IND and another column NEW_IND. The column NEW_IND contains the new codes for the…
-
1
votes2
answers100
viewsCorrectly convert value into scientific notation for text in R
I am a bit aimless with a problem with my data frame. Below a table of an SQL server and one of the columns brings the numbers of each process. This value is a long numerical sequence that R…
-
1
votes2
answers39
viewsUsing If in R in a data frame where the column is string
I have a data_frame with two columns (UF and Municipality). I want to create a new column named region through the column UF. I did what described below, but it was a mistake. I’m a beginner in R…
rasked 3 years, 4 months ago Patricia Pelissari 21 -
1
votes3
answers61
viewsHow to transform data frame variables into the indexes of a matrix with R?
I have a data frame with a lot of information and need to rearrange it in another matrix. The data frame is of the type: userID itemID rating 169 242 3 186 302 3 22 377 1 (the matrix has 10,000…
-
1
votes1
answer46
viewsHow not to display levels without values using scale_fill_manual?
This is the data.frame for behavior playback: structure(list(CAATINGA = structure(c(2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,…
-
1
votes0
answers30
viewsAssociating grouped bar graph with dots connected per line
Good night I would like to create a secondary y-axis in the graph below where you will plot dots connected per line. The date.frame I wish to plot on the secondary Y axis is: ATR =…
-
1
votes1
answer46
viewsPlot plots grouped bars associated with dots connected by rows
I am not able to perform the grouping of the bars of the graph below even using the argument position = "dodge" in the geom_bar. I found searches only with individual bars, I’m having difficulty…
-
1
votes1
answer35
viewsI calculate in R, data value with the mean and standard deviation of the column
What I have to do is simple: take the value of the cell, subtract with the average of the values of the column, after dividing with the standard deviation of the values of the column. Example: Cell…
-
1
votes2
answers47
viewsPlotted graphs separately in single window
I am trying to reproduce the graphic "1" below for the model "2", however I am not having success in my command used. The idea is to separate into different Plots for a better visualization…
-
1
votes0
answers23
viewsImport and Construction of the Pnad 1999 Sampling Plan
I’m looking to analyze the 1999 PNAD and expand its results to the population, so I’m using the package Survey and , however, my problem lies in the import and construction phase of the sampling…
-
1
votes1
answer27
viewsBarcode graph grouped with moving midline in R
Hello, I’m having a question to structure a chart in R. My intention is to use a grouped bar chart, with a moving midline above it. The chart I have is this: I would like the moving average for each…
rasked 3 years, 3 months ago Lucas Vasques 39 -
1
votes2
answers55
viewsLabel of data overlapping
I want to keep data labels organised in a way that does not overlap with each other. The idea is to keep them above geom_point or below.. depending on the position of the line. How can I proceed ?…
-
1
votes0
answers45
viewsCross two dataframes
Considering 2 dataframes of different sizes: df1 consisting of 2 sets of data pairs (origin, destination) with the same origin (one set aggregates vertices originating in A and another aggregates…
rasked 3 years, 3 months ago user250908 77 -
1
votes1
answer35
viewsPlot order scatterplot ggplot2
I’m doing a scatterplot and mapping the points by color (two categories) and size (a discrete variable). The points must overlap, as they are measured from the same place, in different times The…
-
0
votes1
answer510
viewsRead and explore dat files through R
Guys I have a dat file: "dadodat" How do I open it on the R and exploit it?
-
0
votes0
answers249
viewsHow to install the rges package in R?
I am trying to install rgeos package on R and my operating system is Windows 7. I used command install.packages('rgeos', type="source") and I get the following message: installing package into…
-
0
votes0
answers434
viewscomparison (4) is possible only for Atomic and list types
Good morning, I have a dataframe whose structure is given by > head(citationsAllYears) appln_id_cited appln_id_citn ano_prior 3 636 56755306 2008 4 636 644 2008 5 644 56755306 2008 6 1096…
rasked 8 years, 5 months ago Ivette Luna 1 -
0
votes1
answer76
viewsWeb Scrapping with R, java or html?
How do I extract the data table from the following page:http://www.ons.org.br/resultados_operacao/boletim_semanal/2016_12_16/ena.htm…
-
0
votes0
answers152
viewsAggregate in R using date as key
Good afternoon, I’m using the code: soma<-aggregate(as.numeric(coop[c(10,18,26,34,42,50,58,66)]), by=list(coop$data), FUN=sum, na.rm=TRUE) to aggregate the data based on the date key, which is in…
-
0
votes1
answer5304
viewsHow to assemble models for GLM in R
I would like to do a GLM with the following variables: Response variable: EVI Independent variables: % forest, edge density, number of fragments, temperature and precipitation. Someone could kindly…
-
0
votes2
answers1348
viewsCompare vector elements in R of different sizes
My intention here is to find the elements in common between a and b. a <- seq(from=1, to=5, by=1) b <- seq(from=5, to=13, by=1) x <- which(a==b) Warning message: In a == b : longer object…
-
0
votes1
answer231
viewsHow to install Ebimage package for version 3.3.0 and 3.3.1 of R?
First, I make it clear that I have already downloaded the version of both 3.3.0 and 3.3.1 of CRAN, normally, and uninstalled all previous versions, I have also used the commands:…
-
0
votes1
answer49
viewsConstruind a For using the R
Hello, I think my question is very simple, but come on: How do I make such a move: coef.matrix=matrix(0,4,16) for (k in c(1,4)){ for(i in 1:2){ coef.matrix[i,1]=summary(lm(y ~ x))$coef[2,k] } }…
-
0
votes1
answer384
viewsCompare rows of matrices with different dimensions and return a single logic vector
I have two coordinate matrices, matrix A with 83213 rows and two columns (longitude, latitude) and matrix B with 46886 rows and two columns (longitude, latitude). I would like to compare the…
-
0
votes0
answers371
viewsPlot graphs - R
Does anyone know a library, in R, for plotting graphs with large amounts of vertices ( close to 3,000 vertices)?
-
0
votes1
answer40
viewsHow to insert a marker that grows numerically into a dataframe in R?
I have a dataframe with a column and a certain number of rows that varies. What I’m working on is 17. On each line there is a different expression, more or less similar to "ID 123456, color = blue".…
-
0
votes1
answer505
viewsCreate a sequence of useful days in R
I have a data frame the following columns: Date (Only days of the week and without holidays, of several years) Month Year ... I want to create a sequence of business days. So I wanted a function…
-
0
votes1
answer50
viewsAdjust function with Laplacesdemon
i am trying to make the function adjustment y ~ o/(x*(x+t)^k) through a Bayesian technique through the function LaplacesDemon. However, the values obtained for the parameters are considered good, as…
-
0
votes0
answers87
viewsMake R wait for user
I have a complete program in R, where you first ask the user for a number, using the menu function: menu(c('1','2','3'),title='Escolha um numero') Then, a few lines of code below, this chosen number…
-
0
votes1
answer328
viewsWord cloud Shiny R
I am wanting to make a word cloud using data from a postgresql table. I used an example as a base that I found on the Shiny R site, but I’m not able to do what I want. I cannot change which variable…
-
0
votes1
answer26
viewsHow to access email via Rscript?
I wonder if through some package the R you can access the mailboxes (Outlook, for example) directly. If possible, which package should I use?
-
0
votes1
answer461
viewsExtract raster data from a Shape in R
How to extract raster data from a Shape? */ printf("%d\n", 42); /* Como fazer para extrair dados de raster a partir de um shape
-
0
votes1
answer197
viewsIntegration between R and HTML
I would like to know how I export the results of a code in R to a panel developed in HTML?
-
0
votes2
answers63
viewsNot Available (how to put information in this position)
I need help. I have a dataframe in R with some columns IN (I know it’s a column without information) and would like to add information in this position, but I have no idea how to do it. I need help.…
rasked 7 years, 4 months ago Bianca Lisboa 1 -
0
votes1
answer719
viewsExtract and include SQL data with R
I am designing an SQL database that will have tables that store collected data and a table that stores calculated indexes of this data to be later exposed on a Dashboard. I intend to calculate these…
-
0
votes2
answers97
viewsChaining - R
I have two dates frames, one containing product data and the other containing store data, however I do not have reference variables between them (which would not allow me an Inner Join), my need is…
rasked 7 years, 3 months ago Brenno Rovea 23 -
0
votes1
answer115
viewsMake a subset with the same condition on different bases in R
I’m willing to apply the same condition subset on different bases in the R. I thought the for was going to solve, but I did not succeed. Follows programming used: for(i in c("mar16", "jun16",…
-
0
votes1
answer227
viewsHow to classify a "labelled" variable and assign new labels?
My question is very basic and is this: I have a variable "labelled" with ten levels and different Labels and I would like to aggregate two to two their levels and assign new labels to each of the…
-
0
votes1
answer114
viewsI cannot finish installing devtools on R 3.4.0
I’m using: R version 3.4.0 (2017-04-21) -- "You Stupid Darkness" on Windows 10. When executing find_rtools(), get: Error: execution of command '"C:/PROGRA~1/R/R-34~1.0/bin/x64/R" --no-site-file…
rasked 7 years, 2 months ago Octavio Deliberato Neto 1 -
0
votes1
answer199
viewsHow to compare 3 different variances?
I have 3 different samples of size 5, average 100 and standard deviation 12. How do I compare the 3 variances at the same time? I know I need to make a new table, but I have no idea how to do it.…
-
0
votes1
answer70
viewsStore 10 values in R
Good morning everyone, I have to do an exercise where I have to store 10 values typed repeatedly and say how many are negative and positive. I need to use the while command but don’t know how to…
rasked 7 years, 1 month ago Carlos Winter 39