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
-
2
votes1
answer78
viewsWhat is the alpha argument of the ltsReg function of the robustbase package?
I have a question about the use of the argument alpha of function ltsReg package robustbase. As I understand it, it is responsible for determining the size of the subsets that will be used to adjust…
-
2
votes1
answer1272
viewsHow to print/plot a table in #R?
Consider: dat <- matrix(c(1000, 100, 10000, 10000,3.145,1700.42), 2) In which dat refers to data from the result of a loop, generating a new dat every cycle. I need to present these results, for…
-
2
votes2
answers1477
viewsPlot Graph Multiple Variable Bars in R
I need to assemble a graph in R from a CSV table in bars as follows: The Y axis refers to the total count of each variable (column) on the X axis. Where Y is the number of people and X is the number…
rasked 8 years, 7 months ago Shinforinpola 430 -
2
votes1
answer179
viewsinformation criteria Akaike temporal series
I need to check the percentage of times AIC and BIC choose the real model. For this, you will have to carry out a Monte Carlo experiment. Specifically, 1000 AR(2) and ARMA(1,1) processes must be…
-
2
votes0
answers43
viewsInfluence.measures using LOESS
Is there a possibility to use Fluence.measures from the result obtained with LOESS? For example, be the following excerpt: x <- 1:120 y <- sin(2*pi*x/period) + runif(length(x),-1,1) plot(x,y,…
-
2
votes1
answer309
viewsFunction Predict() does not accept exponential regression in R
Please try to perform a parametric modeling of survival analysis and function predict() is returning an error that does not recognize a variable, but it is there. Following example: base=NULL…
-
2
votes0
answers97
viewsGLMER, longitudinal data, random factor, binomial
I’m using the function glmer package lme4. My answer is binomial. I have 5 schools, with approximately 100 teachers, and a teacher does not work in more than one school, I have 5 longitudinal…
rasked 8 years, 5 months ago Cleber Iack 181 -
2
votes1
answer661
viewsHow to join Bibtex files in R
How can I join multiple extension files .bib in a single file on the R? I’m learning to use the Bibliometrix package, and I need to put together 99 files .bib to a single file. Thank you, guys.…
-
2
votes0
answers97
viewsForecast in R - mobile window -
I have the following process:yt=2+0.7yt-1+Et. I want to make pseudo predictions out of the sample, through rolling regressions and with mobile window containing 50 observations. The forecast should…
-
2
votes2
answers2571
viewsBar graph - ggplot2
I have a data-frame with the structure below. I want to make a simple bar graph that relates the "CID" by type (A, B, C, etc...) with the days of departure and the other with the Calls. df <-…
-
2
votes3
answers126
viewsOrganize data in excel
I have a file with 59 observations and with 93 variables in Excel file and turned to .csv. to create the table in R, however my 93 variables appear in the same column. How do I make them appear…
-
2
votes1
answer84
viewsMessage at the end of na.omit
I’m using the remote na.omit(matrix.work) and the message appears at the end: attr(,"na.action") [1] 3 11 attr(,"class" Does anyone know how to delete this message, because I don’t want it to appear…
-
2
votes1
answer249
viewsColorize a region of the graph
I would like to color only the region within the circle, but I’m not getting it. The program and the image are: theta <- seq(0, 2 * pi, length = 200) r = exp(1i*theta) fx=function(r) { x = r-1…
-
2
votes1
answer1347
viewsHow to check if a column(variable) exists within a 'data.frame'?
I need to check if there are columns (i.e., variables) inside a data.frame before doing any operation, but the past variable is not in string to compare with the colnames or names. Follows the code:…
-
2
votes1
answer252
viewsmultiple columns using geom_lines ggplot
I have this data frame: structure(list(`Exchange Rate` = c(-0.145442175, 0.291096141, 0.489923112, -2.038363166, 1.180430664, 0.188114666, 0.850922634, 1.172142766, -3.980837975, 0.285762444,…
-
2
votes1
answer67
viewsExport package
Guys I created a package in the R, already with the documentation, with the @export in each role, I ask for the Rstudio create the package and all right. But when I import the package it reads all…
rasked 8 years, 4 months ago Wagner Jorge 1,377 -
2
votes0
answers403
viewsError in Solve.default(var(x)) - R
I’ve been trying to build a distribution map for certain species using distance methods. I’m having difficulty getting results via Mahalanobis Distance. The package that has this function is the…
rasked 8 years, 4 months ago Ricardo Adelino 73 -
2
votes1
answer2121
viewsHow to make turn ROC - AUC reversed in R?
Good night I need help making the ROC turn on the R. I’m using the following command: library(ROCR) pred <- prediction(predictions = banco$ic, labels = banco$SM) perf <- performance(pred,…
-
2
votes0
answers43
viewsTransform phylogenetic tree into phyDat in R
Does anyone know how to transform a phylogenetic tree, which is in the form 'txt' to 'phyDat', in R?
-
2
votes1
answer60
viewsChecks for a vertex in R
I am using igraph on R. I have the following graph: Is there any function in R, which returns me a boolean value, which verifies the existence of a vertex?…
-
2
votes1
answer53
viewsIntegrating columns of an Array using R (Error)
This is my matrix: funcao=structure(c(-14.7690673280818, -14.5543581356252, -12.1406211639974, -10.7200919648493, -9.55507848352318, -9.20790894914246, -8.74647670464071, -8.26548763467919,…
-
2
votes2
answers415
viewsImport, read and convert cross data to a data frame.
I have a table that is not in the standard reading format of R, that is, it has a variable in column (time) and two in line with the data arranged side by side (subject and treatment). Someone could…
rasked 8 years ago Weidson C. de Souza 163 -
2
votes2
answers2458
viewsConcatenate values within the same data frame columns in R software
f Could someone help me? Anyway I’m grateful!!!…
rasked 8 years ago Weidson C. de Souza 163 -
2
votes0
answers244
viewsMetricas de machine Learning
I would like to know how to evaluate which model is better. For example: I am learning machine Learning using the dataset the Titanic, and I used Tree decisions, Logistic regression and Random…
-
2
votes1
answer2622
viewsHow to place values in faceted bar charts in R?
I am trying to generate a bar chart faceted with R, according to data frame and below commands: ############################################### ######___PACKGES UTILIZADOS_____###############…
-
2
votes1
answer77
viewsRselenium stopped working, what should I do?
library(RSelenium) checkForServer() startServer() remDrv <- remoteDriver(browserName = 'firefox') remDrv$open()**texto em negrito** Selenium message:The path to the…
-
2
votes1
answer210
viewsPlot the mean in R
how can I plot the average using R Studio and be able to display it with my data set also displayed in dimensional space? The average is represented by this line and the data represented by dots.…
-
2
votes1
answer67
viewsIn R, use fread in a Shh connection with pipe
I have a virtual machine with many TXT files. I usually use an ssh and pipe connection to read the files. When I use the read.csv function there is no problem at the time of reading the files.…
-
2
votes0
answers78
viewshow to run an EOF on R? Spacetime package (or Clim.Pact)
I am currently working with foraminiferous fauna data for mixing layer reconstruction over the past 20ka. We did the reconstruction from the abundance of some species, which represent deeper or…
-
2
votes1
answer780
viewsHow to remove columns from a data frame?
I have this data frame with 275 variables and would like to remove the variables that are not contributing significantly (that have value different from 0 less than 10 times). Can someone help me?…
rasked 7 years, 11 months ago Carolina Bury 109 -
2
votes1
answer580
viewsGraph ggplot axis x
This is my date.: datamatrix=structure(list(month = c(1980, 1980.08333333333, 1980.16666666667, 1980.25, 1980.33333333333, 1980.41666666667, 1980.5, 1980.58333333333, 1980.66666666667, 1980.75,…
-
2
votes1
answer101
viewsIs there any way to eliminate duplicate elements that aren’t exactly the same?
dados1 <- c("10 ANOS DA POLÍTICA NACIONAL DE PROMOÇÃO DA SAÚDE: TRAJETÓRIAS E DESAFIOS", "4-CYCLOPROPYL-1-(1-METHYL-4-NITRO-1H-IMIDAZOL-5-YL)-1H-1,2,3-TRIAZOLE AND ETHYL…
rasked 8 years, 3 months ago Felipe Formiga 23 -
2
votes1
answer304
viewsHow to insert the values and their frequency in a data.frame, from a set obtained by SAMPLE?
First get a sequence of random values set.seed(100) estat <- sample(1:20, replace=TRUE) estat [1] 7 6 12 2 10 10 17 8 11 4 13 18 6 8 16 14 5 8 8 14 The idea would be: 1 Would it be possible to…
rasked 7 years, 10 months ago Rodney Dieguez 23 -
2
votes1
answer709
viewsHow to replace values with NA using element encoding (not position)?
I’m having trouble replacing values on a vector with NA, but using treatment coding (not position). A simple and hypothetical example of my problem is (my data set is too large and I have several…
-
2
votes2
answers251
viewsNormality test for a sample of 12 to 15 thousand observations - R
Does anyone know of a normality test that can be estimated (in R) for samples between 12 to 15,000 observations? The Shapiro.test should have sample size between 3 and 5000, not apply to my sample.…
-
2
votes0
answers44
viewsData import
I’m trying to import a table with datetime values in r, and the values are not imported. The column with the values appears with NA and the following error is reported. Parsed with column…
rasked 7 years, 9 months ago Denis Furtado 21 -
2
votes1
answer225
viewsProblem when plotting with ggplot2 R
I am trying to plot a graph in R to display the maximum and minimum values of some variables beyond a line to mark the 0 of y, however the points of the graph come out completely out of order. I am…
-
2
votes1
answer290
viewsproblems with the agricultural package
I’m having trouble using the farm package. When I put the command require(farm), the following error appears: require(agricolae) Carregando pacotes exigidos: agricolae Error in loadNamespace(j <-…
rasked 7 years, 8 months ago Marcela Massaro Ribeiro 21 -
2
votes2
answers1801
viewsHow to join two csv files in R?
my problem is the following: I have two data files in csv format with same number of columns and same column names (see below). I ask to read the files as follows: > dados_1 <-…
-
2
votes0
answers69
viewsThe use of square root in Edger via Rstudio
I wonder if anyone ever tried to use sqrt in the edgeR via Rstudio to increase your N and significance. I was having some problems with my reads (RefSeq) like Ns low and low differential expression…
-
2
votes2
answers91
viewsAdding the same substring to multiple columns in R
I have a base with 2 lines and 68 remarks called "varnomes" and would like to add the word "PF" at the end of each remark. With that, I tried to use the function Paste:…
-
2
votes1
answer120
viewsHow to exclude variable E observations in a matrix in R?
The situation is as follows: I have a matrix with 271 observations and 14 variables in R. Need to randomly exclude a certain number of crossings and variables, maintaining the order of the remaining…
rasked 7 years, 8 months ago Victor Freire 31 -
2
votes2
answers1175
viewsFind a particular line or specific value of a matrix vector in R
How to build a function that evaluates if any row of the matrix mat is equal to the vector vec both in the code below: set.seed(000) mat <- matrix(rnorm(20),4,5) vec <- c(1.3297993,…
-
2
votes0
answers61
viewsHow to add more data to a spreadsheet using R?
I am doing a work of Bioinformatics using patient data, each patient has a code and this work was divided among other colleagues also, each one got a part. Well, I need to attach the parts of them,…
-
2
votes2
answers135
viewsWebscrape Scoring for Welfare
I needed to extract the information from this site for an excel file, which Members vote in favor, against, abstentions, finally. It’s a webscrape exc, but as I understand html I’m having a hard…
-
2
votes0
answers51
viewsSymbolic operations in the R
I need to multiply two matrices in the R, one has symbolic entries (beta) and the other is a numerical matrix (X), I’ve tried the packages Ryacas and rSymPy, but I couldn’t make it work. After that,…
-
2
votes0
answers42
viewsWhat data format is required for space usage analysis in the adehabitatHR package in R?
I am working with location data (latitude and longitude coordinates obtained from GPS) to delimit living areas with kernel and MCP in the Adehabitathr package. I have already prepared the excel file…
-
2
votes1
answer59
viewsHow to read a file if its name is stored in a variable?
I have a file with names of other 980 files actually, so I wanted to read that file and go storing the names in a variable and then open the file with that name, I tried with read table but as the…
-
2
votes2
answers57
viewsuse of ifelse with Matrix
I need to find the gradient of a function, for this, I’m using the final line of the code below, where it reads: gr2 <- ifelse(y>0,df1bi+df2bi+df3bi+df4bi,dFTbi), note that when compiling the…
-
2
votes1
answer125
viewsHow to create a factor variable from other factors?
I would like to create a nominal variable X (factor) in my data.frame from two other existing nominal variables Renda and Escolaridade: Renda Escolaridade X baixa fund. incomp Sim inter superior Nao…