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
answers78
viewsUse of commands in R and error fixes
I have a large database 1800 rows and 50 columns. Of these 50 columns 3 of them (Density, Biomass and BMI) are answers. I must compare one to one with the other variables. I am doing normality…
rasked 7 years, 9 months ago Herlon Nadolny 63 -
1
votes1
answer111
viewsFetch 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 7 years, 8 months ago Flavio Silva 1,108 -
1
votes1
answer671
viewsReorganize Order of Dataframe Lines
I have the respective data.frame in R: Produto Classificação Comum Quilo 1 ABACAXI HAVAI A GRAUDO 3,32 2,2 2 ABACAXI HAVAI B MEDIO 2,81 1,8 3 ABACAXI HAVAI C MIUDO 2,21 1,4 4 BANANA MACA - 4,5 1 5…
rasked 7 years, 8 months ago Danilo Imbimbo 533 -
1
votes0
answers58
viewslodown - Error in Function: server Response timeout
Trying to use the package lodown, get an error: pns_cat <- get_catalog( "pns", output_dir = file.path(path.expand( "~" ), "PNS")) building catalog for pns Error in function (type, msg, asError =…
-
1
votes0
answers182
viewsWeb scraping on application websites in R
I would like to know some ideas to get the data from this link: http://reportarios.aneel.gov.br/_layouts/xlviewer.aspx?…
-
1
votes1
answer55
viewsRead SQL Microft Exported File 2016
I received a file exported from Microsoft SQL 2016 that has extension . txt and the same with . csv and has this face: I searched, but I haven’t found anything yet, someone has some experience…
-
1
votes1
answer206
viewsClustering in the R
Guys, I need to Clusterize this database and then make the prediction.... I wonder, how could I make the substitution in the right way in this case ? Which type of Clusterization would fit best? I’m…
-
1
votes1
answer241
views -
1
votes2
answers5146
viewsMerge two data.frames into one
I have a routine that the goal will always be the same; Every day it should read a file xlsx with all prices (historical series), pull from a given site the prices referring to the last update date,…
rasked 7 years, 7 months ago Danilo Imbimbo 533 -
1
votes1
answer805
viewsCreation 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 7 years ago Flavio Silva 1,108 -
1
votes0
answers233
viewsHow to interpret Johansen’s test in R?
Hello. I would like to know how to interpret the Johansen test to find out whether or not there is a cointegration between the series involved in the model. Grateful.…
rasked 7 years ago André Morais 29 -
1
votes0
answers67
viewsGDP growth rate in R
I’m using the code pib <- BETS.get(22099) To pull the GDP, turns out he pulls from 1995 to 2017, and I just need 2007,01 à 2013,12. How do I pull only the period I need for the model? Because…
rasked 7 years ago André Morais 29 -
1
votes0
answers276
viewsneed to calculate the frequency of the occurrence of a variable
I have two vectors, one with 387 codes and another with 3,000 occurrences of one or more of these 387 codes. I need to know how many times each of these 387 codes occurred in this vector of the…
rasked 7 years ago C Lederman 5 -
1
votes1
answer3892
viewsBar graph with relative and cumulative frequency
I’m trying to make a bar graph with the count on top of the bars and the relative and accumulated frequencies on the left and right sides respectively but I’m not getting it. The data is: dput(x2)…
-
1
votes0
answers251
viewsHow to compare two straight slopes from polynomial regressions in R?
Hi, fellas. I measured the air temperature every hour of a day in two treatments: below the canopy of 10 plants and in 10 open areas at a standardized distance from each plant. Therefore, I obtained…
-
1
votes2
answers157
viewsUsing a dataframe values in ifelse
I have the following scenario: Data frame - Resources: recursos <- as.data.frame(c("server01","server02","server03")); colnames(recursos) <- "Server" Data frame - Events: eventos <-…
rasked 7 years, 6 months ago Vitor Quix 35 -
1
votes0
answers91
viewsHow to transform a rgb color space into Hsv in R
How do I read an image from a folder, and turn it from rgb to Hsv by extracting an array of pixels for the parameters h, s and v (all by R software)??
-
1
votes1
answer1618
viewsHow to create a column in R under specific conditions?
Consider the following data.frame: data <- data.frame(x=c("a","b","c","d"), y=c(2,2,1,2),w=c(4,4,2,2),z=c(25,16,24,30), k=c("sim","nao","sim","nao")) How to include a new column where we will…
rasked 7 years ago Arthur Baldini 99 -
1
votes1
answer1256
viewsPlay 3d graph with level curves in R software
I tried to add level curves in my Plot as in the second figure below, but I could not, someone knows how I should proceed? #Function density probability library(pbivnorm) bsb <- function(t1,t2){…
-
1
votes1
answer562
viewsA: singular gradient Matrix at initial Parameter estimates
When using the following command to estimate model parameters (bell_model): h <- c(43.34, 35.84, 33.45, 30.94, 27.35, 21.75, 13.75, 57.37, 48.36, 44.62, 41.05, 36.49, 29.92, 21.07, 66.65, 56.65,…
-
1
votes3
answers5361
viewsTell 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 7 years ago Bruno Avila 867 -
1
votes1
answer1848
viewsSelect 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
votes1
answer5247
viewsCalculate mean, standard deviation and coefficient of variation in historical series in R
Good morning, I need to generate the mean, standard deviation and coefficient of variation of the data frame below, from the mat13 to mat16 columns, as below: library(plyr) co_entidade<-c(23, 40,…
-
1
votes0
answers110
viewsJoin two df using the sqldf function
I’m trying to put two tables together using the same species id, but I’m not getting it. Below follow the steps: Importing the fixed file to TNRS for R hp<-fread('tnrs_final.txt', header=T) Now…
-
1
votes1
answer160
viewsPython / R Check density peaks in ggplot2
I have two sets of data formed as follows: A= {id1: 0.3, id2: 0.1, id3: 0.3 ... idn: 0.2} B= {id1: 0.01, id2: 0.04, id3: 0.75 ... idn: 0.9} I used the function ggplot R to plot the densities values…
-
1
votes1
answer146
viewsHow to insert column average in all NA values
Hello. How to insert the average in all NA values. I have a code that I read the file, I check if it’s in and it doesn’t have, but when I turn it into a number, several NA appear and if I remove it,…
rasked 6 years, 11 months ago André Nascimento 1,258 -
1
votes0
answers341
viewsMove the axis on the graph in R
I need to make some heat charts with a legend bar on the side. I also need to lay the axes. However, as I had to slightly increase the dimension of the chart for the caption bar to appear on the…
rasked 6 years, 11 months ago Rebecca Souza 13 -
1
votes1
answer60
viewssum different data frames based on column names
I really need your help to finish an analysis. have the following tables (data frames): df1<-data.frame(c(0,1,1,0),c(1,0,0,1),c(1,1,0,0)) colnames(df1)<-c("0","0.5","1")…
rasked 6 years, 11 months ago Vivian Ribeiro 195 -
1
votes0
answers106
viewsIs ROC curve to GLMM possible?
Friends, My doubt is as follows, I am using the following code in R to construct a ROC curve , but I cannot say if in case of GLMM (Mixed Generalized Linear Model) I can use and if in this case the…
-
1
votes1
answer923
viewsData containment <- R
in the R (rstudio) I have a vector v1 <- c(543, 543, 543, 675, 675, 675, 675, 22, 22, 22, 90, 90, 87, 876, 867). I’d like to get a vector vr which represented the count of v1 (increasingly 1:n)…
-
1
votes1
answer306
viewsHow to plot a curve to separate data?
I’m testing some things in the language and I came up with this question. I made a program that has a database that is divided into two groups (Group 1 and Group 2) and its elements are already…
-
1
votes2
answers1675
viewsPercentage Frequency in R with dplyr
I wanted to use the dplyr package to calculate the Relative Frequency by group. I have a database like the first three columns below and I would like the last column to be the answer variable: CNPJ…
-
1
votes1
answer391
viewsError in setValues : Std::bad_alloc when running the Aggregate function in a raster file
While performing the Aggregate function to reduce the resolution of a raster file I am getting the error below, Error in setValues(out, .Call("_raster_aggregate_fun", x, dims, as.integer(na.rm), :…
rasked 6 years, 10 months ago Thiago Mota Azevedo 11 -
1
votes1
answer58
viewsBootstrapped confidence interval for GLMM model parameters
I am doubtful to generate a confidence interval that I have been asked to when it is a GLMM Normally if it were not binomial would do for example like this: library(boot) library(lme4)…
-
1
votes1
answer1223
viewsFunction tapply - arguments must have the same length
Hello, good night! I have a data frame with thousands of rows and 58 columns containing, for example, supplier, material, quantity of material and total value of material. I made an example below,…
-
1
votes1
answer357
viewsHow do I describe a straight line equation of a glmm in an xy graph on R?
Hello, I have data on age (X) and species richness per sample (y). I made a glmm and would like to know how to write the equation correctly in the figure in R. Someone has some site/paper to…
-
1
votes0
answers267
viewsGenerate random numbers in R with Skew-Normal Bivariate distribution
I did the script below, but I doubt if it is correct, I need to generate a bivariate vector with medium skew-normal distribution mu=(mu1,mu2), matrix of variance and covariance…
-
1
votes2
answers1149
viewsHow to delete rows from a Data Frame in R based on the values of one of the columns?
I want to exclude rows that have a certain value in a column. let’s assume I have a DF where the first column is an index with alphabet letters, but, I don’t know the position, I want the lines with…
rasked 6 years, 8 months ago Elias Flávio de Paiva 21 -
1
votes1
answer50
views@slot Extraction
Does anyone know what a slot extraction? I’m trying to follow a script and a part of it is: data <- data.frame names(data) unique <- unique(data@data$binomial) binomial is the column I need to…
rasked 6 years, 8 months ago Myrla Rocha 11 -
1
votes2
answers1214
viewsInsert vector value of a data.frame into another data.frame
I have two data frames. The first one has 2185 observations and the second one has only 9. The first data frame, whose name is dados, contains the following variables:: local, parc, arv, DAP, Ht,…
-
1
votes1
answer446
views -
1
votes0
answers57
viewsUnassigned list
I intend to associate a column of Ids to their name. I mean, in each line of IDS I have a list of genes. and to that list of genes I want to associate the names of the genes. Here is my code:…
-
1
votes2
answers97
viewsHow to run a model for each subset of data of a time series to see
I have a database that has feed consumption information (190 animals) every day (88 days). Goes below table1 <- read.csv("Data.csv", header = TRUE) table1 Animal Dia Consumo 1 1 245 1 2 256 1 3…
rasked 7 years, 2 months ago Luciano Hauschild 431 -
1
votes1
answer857
views"Error: caption Outside float" in R Markdown
When I try to compile my Markdown R code, I get the following error: ! Package caption Error: caption Outside float. See the caption package Documentation for Explanation. Type H for immediate help.…
-
1
votes1
answer111
viewsDouble factor in r with letters for differentiation
Dear friends, I’m trying to perform a double factor analysis or two-away Anova. I would like to know how to generate the letters of differentiation between treatments for the two factors. This…
-
1
votes1
answer1499
viewsI need to add captions to my chart in R
#--------------Biblioteca necessária para gerar gráficos library(ggplot2) #setwd( '/home/gabriel/Videos' ) #-------------------------------Carrega arquivo csv dados1 <- read.csv(file.choose())…
-
1
votes1
answer2251
viewsBar graph with percentages - ggplot2
v1 = c("Sim","Não","Não","Não","Não","Sim","Sim","Sim","Sim","Sim") v2 = c("branco","branco","pardo","preto","pardo","pardo","preto","branco","preto","pardo") dados = data.frame(v1,v2) I want to…
-
1
votes1
answer264
viewserror in balancing with SMOTE
Hello, I have a somewhat unbalanced dataset and wanted to do some testing with smote, but I’m getting an error: library(DMwR) treinoSmote <- SMOTE(TARGET ~ .,m,k=5, perc.over = 100, perc.under =…
rasked 7 years, 1 month ago Geovani Ferreira 129 -
1
votes1
answer221
viewsValues in the chart axes in Rstudio
Hi, I’m new to R. I plotted the data I wanted, but no value came up. How to solve it? It’s little data. The data are as follows, filling only the fourth column (Avg.1). From now on I thank anyone…
-
1
votes0
answers77
viewsGLM with the multivariate normal
Is there a function that performs GLM with the multivariate normal probability distribution function? The way to write the formula will be equal function glm(), i.e. y~. , or it will have some…
rasked 6 years, 7 months ago Márcio Mocellin 1,443