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
answers117
viewsError using getSeries function to pull data from BACEN
Could you help me? I need to download data from the central bank using this routine here: library(SSOAP) library(XML) library(RCurl) wsdl <-…
-
1
votes1
answer110
viewsPercentile Ranking - R
I need to divide a time series into 20 equally spaced percentiles and create a ranking for that division by classifying implied volatility levels, in this case. The time series is composed of daily…
rasked 5 years, 6 months ago AparecidaMartins 21 -
1
votes1
answer45
viewsreceive emails using R
I have done several researches and I find a lot of information on how to send email through R, but I couldn’t find anything on how to receive email through R. I couldn’t even find a library to start…
-
1
votes0
answers46
viewsEstimates of ordinal regression with signal exchange
I am trying to reproduce the results that are in the book An Introduction to Generalized Linear Models third Edition of Dobson and Barnett, on page 161. The adjustment is an ordinal regression…
-
1
votes1
answer107
viewsText Mining python or r
I am trying to extract information from PDF files to popular a table without having to read the PDF. Only I can’t find any references that indicate how to do this. I need, for example, to discover…
-
1
votes2
answers80
viewsForm Equation in R-Multiple Regression
I need to solve a question in the R and I have no idea how to make the R give me equation that adjusts the data,: I have data from the following tables: Idade X1 = (38,46,39,43,32) Anos de Faculdade…
-
1
votes1
answer31
viewstransfer empty spaces from the database to the last column in the R
Good afternoon To help me with the problem I set up a fictitious database dados1<-c(15,15,16,17,18,52,48,47,65,32,'',15,14) dados2<-c(15,15,16,17,18,52,'',47,65,32,15,15,14)…
rasked 5 years, 5 months ago Henrique Faria de Oliveira 725 -
1
votes0
answers56
viewsGene Ontology and gene interaction network in R
Hello, I have a gene expression dataset organized as follows: Gene FC12h QV12H FC10d QV10d Rp1 -0,371 0,797 2,647 0,718 Sox17 15,200 0,438 2,946 0,445 Mrpl15 -1,789 0,218 0,752 0,004 FC represents…
-
1
votes1
answer122
viewsHow to return the most prevalent category associated with a group?
I have a database, in which the variable a is the group variable and b a variable with some categories. My goal is, within each group of a, return what else appears in b. Consider the dput:…
-
1
votes3
answers193
viewsConditional formatting on line R
I wanted to replace the empty fields (Nas) in 'number of turns' with the variable (VAR1 - 3) that is filled. I plan to do it in a larger date.frame. As you suggest?…
-
1
votes4
answers1763
viewsHow to know which is the largest variable of a vector in R?
Suppose I have the following variables: x = 2 y = 3 z = 5 And turn them into a vector: vetor = c(x,y,z) I thought I’d use the function max: max(vetor) [1] 5 But if I use the function max returns a…
-
1
votes1
answer43
viewsAverage column value within a table with R
I need to generate the average in a column of value of a table in R, but I’m not getting it. I’ve done so creating a vector: x <- c(15,12,8,9,5,6,1,2) mean(x) It works, but when I point to the…
-
1
votes1
answer29
viewsHow to choose the best in each year of a column in R?
I have a table with the efficiency of each player, the year of the season and the name of the player. How can I get you to give me a final table with the best player (highest efficiency) each year?…
-
1
votes1
answer87
viewsSimultaneous threading (parallel processing) in R and serialized recording in Sqlite
Hey there, guys. I am trying to develop a code that makes it possible to perform parallel processing (parser) of HTML files using the R Language and, consecutively, record the data extracted from…
-
1
votes0
answers30
viewsCreating objects with rpy2
There are two ways to create R objects using rpy2? I have an example: import rpy2.robjects as robjects # Criando um objeto R a partir do Python robjects.r(''' rfunc <- function() { print("ola") }…
-
1
votes2
answers45
viewsSelection/Cleaning of information in a column
I have a database with thousands of rows, but in one of the columns the data is like this: XLOCAL Estirão do Equador, Rio Javari (04°27'S;71°30'W) Alto Rio Paru de Oeste, Posto Tiriós…
-
1
votes0
answers45
viewsProblems in the while-R condition
Hello ! I have a problem in my condition in the while cycle . It does not recognize when it should stop and is in an infinite loop. The purpose of the function is to count what is between "a" "t"…
-
1
votes1
answer198
viewsFilter a data frame by a column values
I have a data frame with values of a column being a user ID, some of the values in this column are with two copies or more, being the first line with ID replicated the latest and the other older. I…
rasked 5 years, 5 months ago Jônathan Ferreira 21 -
1
votes1
answer64
viewsHow to extract separate data from an out-of-format string
When extracting data from a pdf in R, extracting text line by line, I have the following situation. A string of interest that comes with three information separated by long spaces, as exemplified…
-
1
votes2
answers1298
viewsDate and Time in the same field, how to separate in R?
In a table column, I have the values of DATE and TIME in the same field. Example: 23:02:1989 14:22 I need to separate the Date and Time Value. How should I do? Thank you,…
rasked 5 years, 4 months ago Mariana Bulhões 11 -
1
votes0
answers48
viewsIs it possible for Rmarkdown to load an R code?
I already have a code ready in the R and now I’m learning the Rmarkdown. My question is the following, is there any function that loads the R code in Rmarkdown that allows me to use the information…
-
1
votes1
answer170
viewsAggregating values in R
When trying to add values per person, I get the error below saying that the function sumdoes not work for factors, however, my vector is numerical and even using a function to ensure this, I…
-
1
votes1
answer199
viewsR update on Mac
How do I update R and Rstudio, but without losing the packages I already own? Mac usage
-
1
votes1
answer200
viewsUse of Knn function in R
I’m studying clusters using R. My question is whether, to classify new entrants with an already performed Clusterization, the function Knn can be used, whether for hierarchical or partitional…
-
1
votes0
answers47
viewsShiny App and License
Good morning, everyone I have a question regarding the production of apps in Shiny. If I want to create a Dashboard and charge a paid subscription to access my Dashboard I need to purchase some…
-
1
votes1
answer865
viewsSeparation of rows into columns in R
Friends, I am learning R. I am selecting the biggest consumers of some types of beverage in South America. I need to separate the dataframe below in the following columns: pais, bebida and litros,…
-
1
votes2
answers78
viewsHow to assemble a matrix in R being the values the subtraction of values of a vector
How to create an array in R, whose values are the result of a subtraction of values from a vector? ex.: Vector x <- c(a, b, c) Matrix 1 a-a a-b a-c 2 b-a b-b b-c 3 c-a b-b c-c…
-
1
votes2
answers2399
viewsHow to replace semicolon by dot in a dataframe in R Studio
I am importing a CSV file where the data comes separated by commas, but I need to export them in the R pattern, which is the ".". I have tried using the function as.Numeric, but the values disappear…
-
1
votes0
answers69
viewsHow to calculate the variance and covariance matrix of the BEKK11 function of the MTS package
I have BEKKK11 function of MTS package function (rt, include.mean = T, cond.dist = "normal", ini.estimates = NULL) { if (!is.matrix(rt)) rt = as.matrix(rt) nT = dim(rt)[1] k = dim(rt)[2] if (k >…
rasked 5 years, 3 months ago Everton Toledo 113 -
1
votes2
answers61
viewsRemove items from a list that are part of a character or part of a certain class
Consider the list: mylist=structure(list(quem = 1:10, quer = c(1.1, 2.1, 3.1, 4.1, 5.1), isso = structure(list(X__1 = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12), X__2 = c(123, 456, 789, 1122, NA,…
-
1
votes1
answer225
viewsHow to make a cross from a matrix in R
I have the following matrix: x y A = | 2 0 | | 3 0 | | 1 2 | | 1 3 | | 2 1 | | 2 2 | | 2 3 | | 2 4 | | 3 2 | How can I make a Cross as in the following figure when plotting this matrix on a graph:…
-
1
votes1
answer57
viewsTemporal matching of financial market data downloaded by Batchgetsymbols package in R
Through the following code, I import the stock exchange data the Ibovespa Index, Petrobras and the American Index S&P 500. However, the dates of the observations are not exactly matching #…
rasked 5 years, 11 months ago Henrique Faria de Oliveira 725 -
1
votes0
answers81
viewsConvert string to date in Sparkr - Databricks
I’m treating a dataframe in the algorithm prophet in my work, for both in the Rstudio used the following code to convert data from Data who are like string for Date, because the algorithm needs this…
-
1
votes2
answers634
viewsHow to include a value in the last line of a data.frame in R
I have a date.frame and a value in R, I needed this value to be included in the last row of a certain column of this date.frame. I’ve tested the function rbind but it didn’t work. x <- c(1:15) y…
rasked 5 years, 2 months ago Alexandre Sanches 1,223 -
1
votes1
answer55
viewsTransform level into variable
I would like to create a new column, transforming Tab1612SojaRend$Nível.Territorial the levels "Great Region" and "Federation Unity" in columns. The "Unity of the Federation has to be in the same…
-
1
votes1
answer106
viewsError while exporting data.frame to Excel
I am trying to export a data.frame to Excel, but R shows the following error: Error in . jnew("org/apache/poi/xssf/usermodel/Xssfworkbook") : Java Exception .…
rasked 5 years, 1 month ago Jéssica Jabczenski Roslindo 43 -
1
votes0
answers38
viewsSeparating text into lines
I have a variable named STATUS where the answers are inserted like this: IDENTIFICADOR ESTADO 1 MG / SP 2 RJ / BA I need to adjust to: IDENTIFICADOR ESTADO 1 MG 1 SP 2 RJ 2 BA…
rasked 5 years, 1 month ago Francisco1988 11 -
1
votes0
answers15
viewsReplacing information in the R
I want to use the same R programming file for another analysis and wanted to know how to replace, for example, the name of the attributes, using the same syntax. Thank you
rasked 5 years, 1 month ago Vagner Maximino Leite 11 -
1
votes1
answer18
viewsCompile information on the same line
I need help to compile information on a single line. Here’s an example of df: library(tidyverse) df <- tibble( Name = c("A", "A", "B", "B"), Week = c(100, NA, 200, NA), Weekend = c(NA, 2000, NA,…
-
1
votes1
answer854
viewsHow to clean R’s Global Environment?
What is the command to clear the Global Environment from R?
-
1
votes1
answer1089
viewsGraph by ggplot in Rstudio v 1.1.463 does not read Subtitle and caption in Labs()
I have the problem reported in the title and, I do not understand why in Rstudio Subtitle and caption are not read. When I replay the code in Visual Studio, it correctly loads all the commands - the…
-
1
votes3
answers63
viewsDate printed in wrong format
I am developing an app in Shiny and I have a date printing problem, both in the browser and in the . csv file generated. She gets that shape: The code for obtaining the date is baseEstatistica[6,2]…
-
1
votes1
answer230
viewsHow to send outliers with ggplot + geom_boxplot?
I have the gráfico: library(tidyverse) dataset<-as_tibble(matrix(rnorm(6*1000,1500,200),ncol=6)) cluster<-kmeans(dataset,centers=3) dataset$kmeans<-as.factor(cluster[['cluster']])…
-
1
votes1
answer170
viewsHow to create a data frame with results from a function
I created a function and would like to create a data frame with results of this function for a few hundred parameters values. I did as in the script below, but as we can see the script will be giant…
-
1
votes0
answers66
viewsSum columns of an array per row and place the total in a new column
I have a 5x5 matrix with numerical values, as in the example below: Col1 Col2 Col3 Col4 Col5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 I need to create a new column in that matrix containing…
-
1
votes1
answer896
viewsHow to generate and decompose a Time Series in R?
I’m having trouble generating and decomposing a Time Series. In this case, I was able to create a time series ts, but when I went to decompose the series decompose, indicates that there is an error…
-
1
votes0
answers59
viewsGenerate new matrix by removing a particular column and row
I wonder if there is any R function that I can generate a new matrix by deleting a certain column and row. Matriz_1 [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.0 136.6 123.7 124.3 128.0 123.7 [2,] 136.6…
-
1
votes2
answers49
viewsRedeem results in r
It is possible to rescue only p-value from a simple linear regression in R? I have the following code: reg<-lm(abscissa~ordenada) summary(reg) the answer is: Call: lm(formula = abscissa ~…
-
1
votes2
answers74
viewsProblem in generating multiple charts
I have little experience with R and am picking up a bit to generate a ggplot with 5 geom_lin. Could you help me? The database is five annual series in months. 2014 2015 2016 2017 2018 jan 10 8 7,5 5…
-
1
votes1
answer407
viewsError Reading Bovespa XML Files with R
I tried to use all libraries for manipulation of XML available on R which I found, but I could not, with any of them, perform the reading of the new closing quotation files made available by…