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
answers99
viewsDifferences between brglm and logistf packages
I am working with a dashboard database that contains information about publicly traded companies from BOVESPA. Below follows a piece of this database: My dependent variable is binary (ROIC.MEDIANA)…
-
1
votes2
answers1516
viewsHow to create column from data contained in other columns
Hello, I’m new in R and I’m getting beaten to solve this problem. I have a spreadsheet that I called base and has 2573 observations of 103 variables. I created an auxiliary column named after…
-
1
votes1
answer1006
viewsHow to create a graph with two axes y with different scales in R?
I’m trying to plot a graph with 3 sets of data. " Precipitation" and "Evapotranspiration" have high values (from 5 to 580) so would use the same scale in Y (on the left side) for both plotted data…
-
1
votes0
answers178
viewsProblem in shinyapp publication
The app(ui+server) runs normally but when publishing to http://www.shinyapps.io/ is giving the image error how to proceed to resolve. If necessary I can post the codes.…
-
1
votes2
answers75
viewsHow to change the value of a variable?
I would like to know how to change the value of a variable. I have a numeric variable and would like to change it to a Character.
-
1
votes0
answers237
viewsHow to perform a GLM of a variable with lognormal distribution in R?
I have the problem to define a "Generalized linear model" with the lognormal distribution. Simply the function glm does not accept this distribution and I saw the suggestion to use the following…
-
1
votes1
answer166
viewsHow to increase the number of iterations of a function in R?
My problem is this, when I do the regression >mod<-glm(y~a+b+c,family=gaussian(link="log"), data = matrix) Warning message: glm.fit: algoritmo não convergiu > summary(mod1) ... Number of…
rasked 6 years, 5 months ago Márcio Mocellin 1,443 -
1
votes2
answers3207
viewsReplace specific column values with NA
I would like to detect and replace values above 6 in just a few columns of a data.frame by NA. I made the syntax like this, but it is giving error... Could someone give me a hand? Thank you! data…
-
1
votes2
answers3531
viewsProblem with accentuation - R
I try to solve the problem of accents with this script: Mapa@data$NAME_2 <- Mapa@data$NAME_2 %>% as.character() %>% stri_trans_general("Latin-ASCII") %>% toupper() But when I open the…
-
1
votes1
answer45
viewsRestrict a R code to a certain local machine
Does anyone know if it is possible to restrict the execution of a particular code created in R to a certain local machine? If so, what would be the code?
rasked 6 years, 5 months ago Weidson C. de Souza 163 -
1
votes0
answers56
viewsI can’t understand why this error is returning
Error in round(Transform(x), digits) : non-numeric argument to Mathematical Function My code: leaflet(br_munic) %>% addProviderTiles(providers$OpenStreetMap) %>% addPolygons( fill = T, stroke…
-
1
votes1
answer123
viewsIs there any way to get the standard deviation (R) percentage?
For example.. I have a number of values (prices) related to a product on several different dates. I need to get the percentage change of that amount. Currently, prices are giving a standard…
rasked 6 years, 4 months ago Layla Comparin 553 -
1
votes1
answer182
viewsTurning Chr into a team in R
I would like to turn the variable "Time" (which is in Chr format) into time format. The data is like this:…
rasked 6 years, 4 months ago Erick Kill 5 -
1
votes1
answer58
viewsCreate variables and fill in information from other variables
Software R. I would like to know how to create variables through information contained in a variable and then fill in information that is in two other existing ones. Example I’d like to keep it that…
rasked 6 years, 4 months ago Fabiel Fernando 45 -
1
votes0
answers37
viewsFor is taking the rest of the sample variables in R
I’m making a sample and the size of it is in a spreadsheet called "sizing". When I use the command is, as below, the sample is made, however, appears only the first column for each sample, I would…
-
1
votes1
answer952
viewsHow to insert, as a new column, the names in a vector in R?
I have a vector, called istrain, with names: istrain = c("carri", "challeng", ...) And I intend to turn them into columns of a dataframe, testSparse, which contains frequency of occurrence of words…
-
1
votes1
answer113
viewsHistogram of Dates in GGPLOT
I am unable to perform the ggplot of the following table: Data Frequência 1 2016-06-11 3126 2 2016-03-05 218 3 2016-01-23 431 4 2016-06-04 145 5 2016-11-30 331 6 2016-15-01 275 Through the following…
-
1
votes2
answers82
viewsSeparate 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 6 years, 4 months ago Flavio Silva 1,108 -
1
votes2
answers133
viewsIndicator on R with more than one condition with duplicate values
Suppose there is a basis with two variables as follows: Município IF RIOBOM Cooperativa RIOBOM Cooperativa ABADIA Múltiplo ABADIA Múltiplo ABADIA Cooperativa ABADIA Banco DOURADOS Banco DOURADOS…
-
1
votes0
answers31
viewsError when querying R API created with Plumber
Friends, I created an api in Plumber , when I query this api directly in the browser I can see the data , but when I use the GET() function I have the following error : Error in prettyNum(.…
-
1
votes1
answer46
viewsComparison of two curves
Hello I have to follow a determination of the DRC 166/2017 of Anvisa and one of the things it asks for is the comparison of two straight lines through the slope, intercept and coincidence…
rasked 6 years, 3 months ago Guilherme Portilho Carrara 13 -
1
votes1
answer91
viewsHow to upload to Google Drive from R
I was watching about the googledrive package from R’s CRAN and I’m not getting it to work, how to get it into my account. My goal is to upgrade a data frame and as CSV, direct to my account.
-
1
votes0
answers164
viewsPass R parameters in an api with Post method?
Friends, I created an R api using Plumber with the post method. but when it comes to calling this api and passing the parameters I’m not getting , I call this way: resp <- POST("http:url", body =…
-
1
votes2
answers146
viewsFind a number after a specific word with grepl and regex {r}
Hello, I have a list of addresses and I’m trying to verify which ones have numbers and which don’t. However, I have some strings that end with number and I’m trying to create a regex to filter these…
-
1
votes0
answers26
viewsData security in a Plumber R api
Friends, I created an api with Plumber for client data transfers, that is, confidential data. In the address of the url goes the ip of my machine. Regarding the security of data traffic and the…
-
1
votes0
answers316
viewstidyverse_conflicts()
Loading the tidyverse package shows that there are some conflicts. -- Attaching packages --------------------------------------- tidyverse 1.2.1 -- v ggplot2 3.0.0 v purrr 0.2.5 v tibble 1.4.2 v…
-
1
votes1
answer177
viewsHow to interpolate soil depth values using "Spline"? Or using the "aqp" package?
Hello, I would like to interpolate the soil depth values in the columns "top" and "bottom", (every 5 units) in the soil data, for example in the dataframe: id_num id_name horiz top bottom K Mg Ca…
rasked 6 years, 10 months ago Yuri Gelsleichter 23 -
1
votes0
answers61
viewsWhat is the best way to select and organize R data?
I have a project that consists of performing non-linear regressions to various data sets from different sources. After performing all these operations, I usually save the results in files. txt, so…
-
1
votes1
answer301
viewsA: Subtitles overlaid [ggplot2]
Hello, personal,I’m having a subtitle overlay problem in ggplot. The following error message appears. Scale for 'fill' is already present. Adding another scale for 'fill', which will replace the…
-
1
votes0
answers38
viewsDuplicate Error Identifiers for Rows Using Spread
I’m looking to fix the data base of IMF, everything worked out, only that at the time of using the function spread(), is making this mistake. Commando: weo <- weo2 %>% spread(key= `WEO Subject…
rasked 6 years, 9 months ago Jonathan Mpoto 11 -
1
votes1
answer128
viewsError in package topicmodels
I am using Rstudio to do my scritps. I try to install a package called topicmodels through the command install.packages("topicmodels") However, I get the following error message: ERROR: dependency…
rasked 6 years, 3 months ago Adriano Gurgel 9 -
1
votes3
answers559
viewsCompare columns of a dataframe with those of others and remove columns that are not common between them
Suppose I have 3 dataframes. In them, I have various columns (e.g. X1, x2..., Xn). However, not all these columns coexist in all dataframes. My goal is to compare these dataframes and leave, EACH OF…
-
1
votes2
answers163
viewsInterpolation of decimal numbers in R
Hello! I have a sequence of broken numbers (e.g. 191.1, 191.48, 191.87) and wanted to turn these numbers into integers (all 191. turn 191). Is it possible to do this in R or excel? I cannot do a…
rasked 6 years, 3 months ago Laís Moreira 11 -
1
votes2
answers240
viewsProblems with the merge function
I’m having trouble with the job merge out of nowhere she stopped "Merger" the date frames.. It seems she instead of using say the cbind, she’s using rbind and what is worst triple echo (each=3).…
-
1
votes2
answers229
viewsText mining with R (stringr)
I have a string lenght 15 and want to remove the first 70 charac. and the last 200 charac. each. I tried the following code to remove the beginnings and it didn’t work: texto2009a <- texto2009…
-
1
votes1
answer112
viewscreate data.frame where the file output is placed in columns
Hello! I have a little problem in R.... I have a file called dados_dia with different weather variables: Índice de claridade (I.Cla),Wind speed (speed), Umidade relativa (hH)and Temperatura do ar…
-
1
votes1
answer592
viewsLines with alternate colors for a category variable ggplot
I have a database with ration per animal per day. Just follow one part of the base to get an idea: Animal Time Consumo 5 1 2.53396 5 2 2.32906 5 3 2.94379 5 4 3.36162 6 1 2.89082 6 2 2.53898 6 3…
-
1
votes1
answer68
viewsHow to isolate a factor from a result as a vector?
I want to isolate a factor from the result and leave it as a vector so I can use this factor in another formula. Example: library(drc) data=S.alba dados$Dose <- as.factor(dados$Dose) alba.aov…
rasked 6 years, 9 months ago Vitor Muller Anunciato 127 -
1
votes1
answer612
viewsHow to leave in a boxplot in R, all x-axis values written in graph?
I’m filling a boxplot type chart on R, but some values it’s omitting. There is only the risquinho in the x axis referring to the boxplot, but the name of that boxplot does not appear. I believe it…
-
1
votes1
answer2529
viewsError installing packages in Rstudio
Every time I try to install some package in Rstudio this error message appears Error in install.Packages : cannot open file…
-
1
votes1
answer2209
viewsPlot 2 plots on one and y axes with different scales
Hello, masters of data analysis I have a problem plotting two Graphics with different scales on the y axis, the left represents unity and the right represents Day. I tried to find some information…
-
1
votes1
answer1036
viewsUse the VIF test
I’m trying to run the VIF test for a two-stage MQO model, but the following shows up: Warning message: In v1 * v2 : length of larger object is not Shorter object length multiple Follows the model:…
rasked 6 years, 9 months ago Matheus Gomes 11 -
1
votes1
answer89
viewsHelp with variable prediction with machine Learning and unbalanced classes in R(Caret)
I’m learning Learning machine techniques to predict sheet size values (numerical) from multiple predictors (numerical). However, leaf sizes are conditioned to life form, (trees or grams), which are…
-
1
votes1
answer121
viewsManipulation of Dataframe in R
I have the dataset as per the figure. I need to name the Mes column where it is 1 is January, 2 February and so on. I still need to group by type of expense and add the reimbursed amount. The idea…
-
1
votes0
answers42
viewsIncomplete tweets in searchTwitter search method
Hello, community of Stackoverflow BR, I’m playing with the library twitteR of programming language R, and I realize that in the search that I have made, the texts are cut, example: "RT…
-
1
votes2
answers574
viewsDoes not create the label on the ggplot2 chart
Hello, I’m here to expose a very basic problem that is occurring, I’m not able to plot along the chart the caption. I’m not going to say much, I’m just going to put my code and the chart print out…
-
1
votes0
answers28
viewsMinimum number of thrifty models in model-averaging (Hurdle Model)
When we performed a multi-model analysis of the Hurdle Model, with the "pscl" package of the R, what would be the minimum number of parsimonious models? In my analysis, I got 2 models; that would be…
-
1
votes1
answer505
viewsHow to upload data to Chunk?
I am venturing into Rmarkdown, I found a very interesting tool. I happen to be in trouble, I think it is basic of beginner, when complicating the Rmarkdown with knitr it gives the unknown object…
-
1
votes1
answer103
viewsaveraging the 15 days before the day in common
Hello! I’m trying to find in the database (agua and meteo) the day of the month of agua in common with the meteo and when to find the meteo finds the same day (for the Alqueva-Montante station),…
rasked 6 years, 8 months ago Maria Lopes 115 -
1
votes3
answers226
viewsAverage temperature in R
Have: Data Sala.1 Sala.2 Sala.3 Horas 1 02/08/2013 20.5 19.7 21.6 15:00 2 02/08/2013 19.7 18.9 20.2 15:30 3 02/08/2013 19.7 19.1 20.0 16:00 4 02/08/2013 19.7 18.8 19.8 16:30 5 02/08/2013 19.8 18.8…