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
votes1
answer283
viewsDifficulty to decompose time series in r
I’m trying to use the R for the first time. I’m trying to assess possible shocks in a VAR model, so I can’t develop the decomp test. being my main question the message "time series has no period, or…
-
1
votes1
answer47
viewsSeparate values from a list of summaries in R
From the previous question How to run a looping in R and store the results of a summary in a vector have as response a list with 20 summaries with values calculated from a specified template. One of…
-
1
votes1
answer46
views"Less" value is removed in R
I have a df that contains negative times, for example: -1:-14:-56 I would like to take all times that were less than 00:00:00 and put 00:00:00 in place. I am currently doing a very manual job in…
rasked 6 years, 1 month ago Layla Comparin 553 -
1
votes0
answers51
viewsHow to isolate specific metadata in a. ris file?
I have a.ris file with information about researchers and a few thousand lines. Each researcher is identified with a set of metadata (these are standardized). I want to know how to isolate specific…
-
1
votes1
answer467
viewsError in scan (file=file, what=what...)
Good Morning, I’m having a bug to run a code on my R. Follow the code below. library(car) library(fBasics) library(NbClust) setwd("C:/Financas") # Salvar na pasta Base = read.table("baseFin.txt",…
rasked 6 years, 6 months ago Matheus Tostes 11 -
1
votes0
answers20
viewsHow to search APP Rstudio Shiny
I’m entering the world of Rstudio Shiny now. One question that came to me is: how do I search for the available/created Shiny Apps? Are all the Apps created available? Is there any way that, once…
-
1
votes2
answers154
viewsUse of if and Else
I have a problem, and I can’t fix it. I am creating a function and at a certain point use ifs and Else. In function x argument : develop <- Function(x, temp, date) I will leave the option for the…
-
1
votes0
answers42
viewsData import error in R
Hello! I imported a base I requested via LAI for R. They sent me in excel, but I converted it into csv by working facilities. I know that when transforming all data from "character" columns to…
-
1
votes1
answer241
viewsError in View : invalid caption argument
I was working on the following script: library(tidyverse) library(dplyr) library(readxl) cirurgia <- read_excel("C:/Users/Agnes/Desktop/Coisas com…
-
1
votes1
answer1068
viewsInclude column in a select
In my work, I always extract from sql, tables, in one of these tables the extracted information is contracts, date, dialing Qtde, service Qtde, Alo Qtde, and so on. I use Rstudio, with a connection…
-
1
votes1
answer49
viewsCommand to describe table data
Hello, I have a database and would like to know which field names through a command in R. What is the best way to proceed? I tried to use describe() but failed.
-
1
votes0
answers105
viewsEmojis do not appear when executing the emo::ji() function in R
I can’t see the emoji from the package emo of R when I file in rmarkdown. I do it this way: emo::ji("smile") Nothing appears and reports no error. In this other way: tibble::tibble(emo::ji("smile"))…
-
1
votes1
answer51
viewsHistogram with a text column
I need to do a histogram. I have the following 3 columns: L courses offered M vacancies offered N filled vacancies Vacancies offered and filled ok, the problem is that I can not put the data of…
rasked 5 years, 11 months ago Sergio Luis 11 -
1
votes0
answers49
viewsImporting data type 1,000 (thousand) html
I’m importing data from the public database:…
rasked 6 years, 4 months ago Daniel Travessini 11 -
1
votes2
answers634
viewsBoxplots - rstudio
I intended to color the various boxplots underlying the code I made (I leave here) but I’m having some difficulty. If it is possible for someone to give some info on how to do it, thank you. Thank…
-
1
votes0
answers1260
viewsNormalisation of data in R
I’m trying to normalize the data and give the following error: Error in if (colSd != 0) res[, i] <- (x[, i] - colMean)/colSd else res[, : missing value where TRUE/FALSE needed the code in R is…
-
1
votes1
answer656
viewsInsert more than one line into a chart in the R
Good morning, I’m trying to insert three horizontal lines in my chart, but when I use the abline function, I only insert one. Also, I’m having difficulty inserting the vertical line, since my x-axis…
rasked 6 years, 4 months ago Diego Peliciari 319 -
1
votes1
answer95
viewsHow to take the variation with respect to the number of days of the date difference in R
I have a table in csv with 5 information, two with dates, two with prices, and one with the difference between dates. I have date 1 fixed on a date and date 2 varying. For example: 10/01/2018 >…
-
1
votes1
answer159
viewsHow can I add the identical values in the column of a data frame?
The column has values such as: 1, 2, 3, NA. I need to group those who are equal. For example, if you have 4(1)s, the new table will have a row with value 4 representing the quantity of 1s.…
rasked 5 years, 10 months ago Bruno Fernandes 29 -
1
votes1
answer35
viewsTake previous values of a variable if the current value is 0 with a condition using dplyr in R
I have a database as follows: CNPJ data dataquebra alto 2222 201603 201711 s 2222 201511 0 s 2222 201702 201711 s 2222 201704 201711 s 3333 201601 201711 s 3333 201509 0 s 3333 201512 0 s 3333…
-
1
votes1
answer117
viewsOrdering Feeling Table(Tidytext)
I am trying to create a table based on the Chapter-Book-Feeling-n leaving the Chapter always in original order:"The Boy Who Lived", "The Vanishing Glass," "The Letters from No One", "The Keeper of…
-
1
votes1
answer112
viewsLinear regression looping in r with alteration in the variable y
I’m doing a regression model Y ~ X1 + X2. Y are financial market shares (change in daily liquidity). X1 is a portfolio with the most traded shares (1st quartile), tb with the variation in daily…
-
1
votes1
answer832
viewsHow to insert a legend on a map in R?
I did a cluster analysis k-Means fictitious. I want to create a caption (cluster1, cluster2 and cluster3), which is represented by the variable "kmeans" (formed clusters). I do not know if it would…
-
1
votes2
answers53
viewsHow to know in which position an unknown is located in a vector?
Example: a=c(10,9,8,7) b<-max(a) a[b] I need to know in which position b is located in vector a, R must return 1 (which is the answer)
-
1
votes1
answer446
viewsR - Create Binary Variable (dummy) value 1 for 50% of the total
Well, I’d like some help, I have these data each column has 100%, first wanted to index from the largest to the smallest and later make use of the dummy variable of value equal to 1 for the species…
-
1
votes2
answers206
viewsr - average of one variable relative to the values of another variable in a data frame and take NA values
I have a multi-column dataframe. How do I calculate the average of one variable based on the values of another variable? I have the frequency of several species found in 4 campaigns and I want to…
-
1
votes1
answer329
viewsInsert two commands (INSERT and UPDATE) into the same instruction in Sqlite, via R Language
Hello, everybody I have a problem in knowing how to insert two commands (INSERT and UPDATE) in the same instruction in Sqlite, via R Language. I don’t know if this is impossible due to Sqlite or R’s…
-
1
votes2
answers812
viewsHow to count the number of frequencies for each column in a date.frame in R?
I need to count the number of frequencies in each month, where each month is represented by a column: USUARIO jan fev mar abr mai jun jul ago set out nov dez 1160 0 1 1 1 1 1 1 1 1 1 1 1 2505 1 1 1…
rasked 5 years, 9 months ago Izak Mandrak 1,059 -
1
votes1
answer236
viewsr - average of one variable relative to the values of another variable in a data frame within each grouping
This question is after one posed by me recently. This is the link if you want to follow r - average of one variable relative to the values of another variable in a data frame I have a dataframe with…
-
1
votes2
answers1914
viewsArgument is neither numerical nor logical: returning NA
Searching for answers about the mistake I came across while trying to analyze data in the R, I found a very similar case, but not identical to the one I came across. So I decided to write my…
-
1
votes1
answer320
viewsNotice: "In sqrt(diag(Object$vcov)): Nans produced" in Hurdle Model
Hello! I have a data set, with which I intend to perform a test to analyze the influence of some predictive variables on a response variable; as there are many zeros in my response variable (there…
-
1
votes1
answer643
viewsConvert String to float in R
Hello, how do I convert b <- format(round(3, 2), nsmall = 2) [1] "3.00" Therein [1] 3.00 I have tried using.Numeric, as.double, but always returns 3 but I need 3.00…
rasked 5 years, 8 months ago spiderman123 111 -
1
votes1
answer230
viewsHow to ignore and not iterate over a for in R
I am using this command to calculate 4 values extracted from a function summary without (sem_smry). 100 attempts are made where, if you report a mistake, the attempt is counted but not computed. I…
-
1
votes1
answer164
viewsHow to increase the bars of a chart in R?
Does anyone know what the command is to let the bars of the graph generated by the code below get wider? library(lattice) rend <-…
rasked 5 years, 8 months ago Vitor Hugo -
1
votes1
answer535
viewsImport xls file to R
The data can be obtained by Link <- https://github.com/marcosvafg/salario_juizes But precisely the file name is Salarios_juizes_tjsp_122017. The file is protected, so I can’t change it. I wanted…
-
1
votes1
answer29
viewsGenerate subsequent month in R
How do I place the following month? df1 dt nome idade 01/03/2018 ll 15 07/03/2019 dd 33 31/12/2019 ff 44 After rules df1 dt nome idade 01/03/2018 ll 15 01/04/2019 dd 33 01/01/2020 ff 44 The rule is…
-
1
votes1
answer84
viewsHow to create a column with specific conditions?
I have a database that way: cod ano MUNICIPIO pmat 1 110001 1998 ALTA FLORESTA D OESTE NA 2 110001 1999 ALTA FLORESTA D OESTE NA 3 110001 2000 ALTA FLORESTA D OESTE NA 4 110001 2001 ALTA FLORESTA D…
rasked 6 years, 2 months ago Danilo Imbimbo 533 -
1
votes1
answer258
viewsTurning the y-axis into a percentage
Good afternoon, I have the following command which generates the following graph: CANDIDATOS_2018_LEGISLATIVO %>% group_by(DS_ESTADO_CIVIL, DS_GENERO) %>% count() %>% ggplot(., aes(x =…
-
1
votes1
answer68
viewsHow can I assign a variable to a table?
This table is only in one column ! I need to assign the age(age) variable, to make the average, variance, ..., but I can’t do it because they are in the same column.…
-
1
votes1
answer139
viewsCross Validation following the dataset
Regarding cross validation, I would like to know if when we use the command below the system makes a random choice of data or sequential. I am looking for a way to use the data order to generate the…
-
1
votes0
answers84
viewsConfidence interval
I would like to generate the confidence interval values for some explanatory variables of the HUNTED response variable. The data is distributed in 3 distinct time periods. However, when I use the…
-
1
votes1
answer248
viewsInsert rownames/ values as a new variable in a list dataframes
Suppose n dataframes within a list. Each of these dataframes has different lines. For example, in a dataframe, rownames are characters (make of cars) and in other, rownames These are hospital…
-
1
votes1
answer1547
viewsHow to change the date format from "year/month/day" to "year/month" in R?
Suppose I have a date in the standard English format "ymd", example: Sys.Date() "2019-04-11" Since for my analysis I do not need this date to have the days and I decide to remove them, so that it…
-
1
votes0
answers133
viewsExtract only numbers from a list
I’m using the package on the R fbRads to collect data from Facebook Ads. However, when I turn it into a data frame, I get a list of the values, rather than the numerical value. How can I separate…
-
1
votes0
answers422
viewsHow to troubleshoot "cannot coerce class ""group"" error to a data.frame"
When rotating the script below, specifically in the part of reproduction of data.frames error was returned: Error in as.data.frame.default(x[[i]], optional = TRUE, stringsAsFactors =…
rasked 6 years, 2 months ago Fabiano França 33 -
1
votes0
answers189
viewsNeural Network in R - Input Data
I’m having a problem with input data from a neural network, I’m working with inputs of 5000 pairs of numbers, these numbers are displacements in X and Y, that is, based on the previous frame and the…
-
1
votes1
answer58
viewsCaption in matplot command
How do I create a legend in the matplot command? a = rnorm(1000) b = runif(1000) matplot(cbind(a, b), type = 'l')
rasked 5 years, 7 months ago Vitor Hugo 151 -
1
votes4
answers188
viewsImport Excel file to R
I am having trouble importing an excel file into R. I am using readxl package, my working directory is set in the same location as excel file : setwd("C:/R sidra") However, when executing the readxl…
rasked 5 years, 6 months ago Ingled M Cardoso 159 -
1
votes1
answer133
viewserror when importing . ODS in R
I’m trying to import a table. ods in R library(readODS) setwd("~/Documents/Mestrado/dissertacao") dados <- read_ods("teste.ods", col_names = T) however when loading the worksheet it does not…
-
1
votes0
answers104
viewsRmarkdown with mixed accents
I wrote a report in Rmarkdown that, after a Windows update, it changed all accents by other characters. The main issue would be to read the external files. But there is a part that I need to read…