Most voted "rstudio" questions
Rstudio is a free and open source (IDE) integrated development environment for R
Learn more…175 questions
Sort by count of
-
11
votes3
answers3977
viewsOrganize data in Excel to open as table in R?
I have a file with 50 observations and 3 variables in Excel file (.xlsx), and turned to .csv. I used banco1<- read.csv("teste1.csv") to create the table in R, however my 3 variables appear in the…
-
11
votes2
answers930
viewsError "invalid input '.. 'in utf8towcs" with "read.csv"
I have a database on . csv that gathers posts from both Facebook and Twitter. For the reading of the bank in R, the code I have used is bancodedados <- read.csv("nomedobanco.csv", sep=";",…
-
9
votes1
answer196
viewsRstudio: do not automatically load variables in Environment
Whenever I start Rstudio some variables appear in environment. Is there any way to remove them automatically without using the famous rm(list=ls())? Thank you!…
-
6
votes1
answer1449
views -
6
votes3
answers1376
viewsFill column of a data frame with data from another data frame in R
I have the following df (data1): ITEM CLASSIFICACAO 123 AZUL 456 AMARELO 789 234 VERDE 345 PRETO 456 567 678 ROSA I need to fill in the blank lines of the column CLASSIFICACAO using another data…
-
6
votes1
answer320
viewsRecursion in R error
I have the following recursive function: tamanho <- function(v){ if (is.null(v)){ return(0) } i <- tamanho(v[-1])+1 return(i) } I’m using Rstudio, and when I call the function with this…
-
5
votes1
answer1121
viewsPackage installation in Rstudio
I cannot install any Rstudio package on my laptop. Does anyone know what I should do? Appears this message below:
-
5
votes1
answer195
views -
5
votes2
answers183
viewsTrying to generate a graph of a time series
That’s what I did.. #Lê a base de dados ano1<-read.csv("os dados abaixo...",header = TRUE ,sep=";", row.names=1) #Cria a série temporal ano<-ts(ano1[,1],start=c(2009,1),…
-
5
votes2
answers331
viewsFilter Different texts at different positions in R
Good afternoon. I have the following data: NOME <- c("MARIA 1001", "MARIA 1002A", "JOSE 1003B", "PEDRO 1003", "CARLOS 1019J", “ANTONIO 50”, “MARIA 80”) VALOR <- c(10, 20, 30, 40, 50, 60, 70)…
-
5
votes1
answer310
viewsProblems accessing a website via Rstudio
Problems when connecting there is a particular site via Rstudio url <- "https://www.jusbrasil.com.br/diarios/busca?q=%22licen%C3%A7a+sem+vencimentos%22&idtopico=T10001849&o=data" links…
-
5
votes1
answer50
viewsProblem creating a data.frame
I want to export several results to excel and for that I need to first leave them in the ideal format, but I am facing problems because I want them to be stacked in a single column. This is an…
-
5
votes0
answers49
viewsConsider return routes in the same way
I’m having trouble coding the variable rota in the R so that it assumes a unique value when the route is the same, independent of the point of origin (first 4 characters of the route variable) and…
-
5
votes1
answer298
viewsCompare objects in R
I have two dataframes: atualizada PIMPF_Br_A_1_sa PIMPF_Br_A_2_sa 1995-01-01 74.35501 35.59109 1995-02-01 74.06131 35.43400 1995-03-01 74.06131 35.93259 and: atualizada PIMPF_Br_A_1_sa…
-
5
votes1
answer62
views'The number of derivatives returned by func() (2) must Equal the length of the initial conditions vector (4)' in R
I’m using ode, package deSolve to solve an R ED system, but I get the error: Error in checkFunc(Func2, times, y, rho) : The number of derivatives returned by func() (2) must equal the length of the…
-
4
votes1
answer4059
viewsHow to run the current line in Sublime Text 2? Or, IDE that allows running the current line in Python
In the rstudio (IDE to r) it is possible to run the current line instead of the entire file using ctrl (or cmd) + enter. This is very useful for when you want to test just one piece of code separate…
-
4
votes1
answer672
viewsR-Studio - Package installation error
I try to install the package from the .zip, but the following message appears: R Tools for Biologists (Rt4bio) Funtions: rdiagnostic: Make a Diagnostic residuals Plot. plotbar: Use barplot2 from…
-
4
votes2
answers22615
viewsUpdate the R version of Rstudio?
The version of the R I have installed is outdated. What is the procedure to update the R considering that I use Rstudio in Windows?
-
4
votes2
answers999
viewsHow to read data with variables in lines, in Rstudio?
I am starting with the R language in Rstudio. I am an advanced MATLAB user but with difficulties in R. My question is: I have a spreadsheet where each row is a variable and each column is an…
-
4
votes1
answer66
viewsWhy does rvest break when processing an empty file?
When trying to process the contents of an empty file the package rvest locks and closes the RStudio. Follows small reproduction of the problem: tf <- tempfile() file.create(tf) html_erro <-…
-
4
votes1
answer376
viewsExtract table from a website for Rstudio
Hello, I want to take the table of the Brazilian, for example this site "http://globoesporte.globo.com/futebol/brasileirao-serie-a/" and extract to a dateset in Rstudio, so that whenever the table…
-
4
votes1
answer1978
viewsProblem with forecast in R
I’m trying to make a relatively simple GDP forecast, but I’m finding the following mistake: **Error in model.frame.default(formula = y ~ t2, drop.unused.levels = TRUE) : comprimentos das variáveis…
-
4
votes1
answer1440
viewsArrange bars of a bar graph in R
I’m filling the following data into the R to generate a bar chart: structure(c(5483L, 28034L, 7995L, 5199L, 6785L, 7452L, 7692L), .Dim = 7L, .Dimnames = structure(list(c("dom", "qua", "qui", "sáb",…
-
4
votes3
answers3012
viewsAggregate function on R
Good afternoon. I’m using the function aggregate to group some data. However, I am only using one variable to add up. I would like to use more than one variable. Is this possible? I am using the…
-
4
votes3
answers11076
viewsTurning factor into numeric R
Good night! I am doing a job where I import a base and after the import I create a range of values. Ex. I import the base with the read.csv dados <- read.csv(base, header=TRUE, sep=',') Put in…
-
4
votes1
answer334
viewsHow to plot a plot with ggplot
I have the following date.: sample OPN1SW OPN1MW OPN1LW RHO OPN3 OPN4 OPN5 1: GTEX-11WQK-1026-SM-5EQLX 2.365 0.0000 0 4.138 86.322 40.199 12.533 2: GTEX-XQ3S-1426-SM-4BOPR 22.317 0.0000 0 30.693…
-
4
votes1
answer1104
viewsRun a file . R within another code in R
I have a code that reads the XML files that are in an enterprise network folder, and generates a file .RData. I have other codes that generate different reports for different sectors, using as a…
-
4
votes1
answer103
viewsStacked area chart
I’m trying to make an area chart according to the image below: But I’m using a different database than the one used for this graph and I’m having some questions: 1- I am using the following code:…
-
4
votes1
answer342
viewsBar graph with different colors in ggplot2
I have a bar graph in the R with percentage variation, I would like the negative percentage values to be red, as in this example: But my chart is getting this way: Code I am using:…
-
4
votes1
answer130
views(Language R) How to make the axis of the graphs more detailed in ggplot2?
I would like to know how to add more numbers to my y axis, so that the bottom grid has more horizontal lines. Note that in my chart, the Y-axis only shows the markings every 500 units (0, 500, 1000…
-
4
votes1
answer82
viewsWhat are the differences between Rmarkdown and Rnotebook?
The RMarkdown has become a very popular interface and file type in recent years. I believe this is due to the fact that it allows using a single software to write complete statistical analysis…
-
4
votes1
answer85
viewsScatter plot in ggplot2
Talks guys I’m wanting to create a scatter chart in R using the ggplot2, a scatter plot with gene size (lengthbp) X variants (frameshift, splice_acceptor, splice_donor, stop_gained), the figure…
-
3
votes1
answer271
viewsSpecify Miktex path in Rstudio
I am trying to compile a file . Rmd to pdf using Rstudio’s Knitr. As I am using a computer (Windows 7) with permission restrictions, I had to install Miktex in the Documents folder and Rstudio is…
-
3
votes1
answer1327
viewsHow to change table rows in R by values from the same row only from another column
[,1] [,2] [1,] "NAO INFORMADO" "1" [2,] "2" "3" [3,] "NAO INFORMADO" "5" [4,] "4" "1" [5,] "NAO INFORMADO" "3" [6,] "6" "5" wanted to change all values not informed by the values in column 2 of the…
-
3
votes1
answer511
viewsI need to create a column with the ln of a variable in the same data frame
I have a series of data for example GDP and I need to create a column next to it with the variable lnPIB, as I do in R?
-
3
votes2
answers530
viewsFilter Different Texts in R
Good afternoon, I have the following data: NOME <- c("LEITO 1001", "LEITO 1002", "LEITO 1003", "LEITO 50", "LEITO 60") VALOR <- c(10, 20, 30, 40, 50) dados <- data.frame(NOME, VALOR) I need…
-
3
votes3
answers1220
viewsUse of the sub function in R - string with special characters
I am operating a database with the following values: data$Col_new <- data$Col_old Col_Velha Col_Nova Médico Médico Médica Intensivista Médico Técnica em Enfermagem Técnica em Enfermagem…
-
3
votes1
answer2384
viewsAdd two or more covariables to the R
I have a database with several ID (rows) and in the columns the covariables. These covariables are repeated in other columns with different information about the same ID. How to join these…
-
3
votes1
answer151
viewsCustomize boxplot
I have the following data: structure(list(NotasMateriais...4. = c(1L, 2L, 8L, 5L, 5L, 4L, 4L, 2L, 9L, 2L, 5L, 3L, 1L, 3L, 0L, 3L, 3L, 2L, 2L, 3L, 0L, 2L, 14L, 0L, 0L, 3L, 6L, 3L, 4L, 3L),…
-
3
votes3
answers743
viewsCount of TRUE and FALSE
I have a vector with only true and false, would like to know how do I count how many true and false have in this vector?
-
3
votes2
answers95
viewsGenerate a date after a specific date
I have a column of a table with dates, I need to create another column with random dates and after this one. I used seq.Date function for this but I get the following error.…
-
3
votes1
answer139
viewsSpeed in crossing tables - R
good night! I cross two bases in Rstudio, using the merge, however, I would like to know if using another crossover medium (ex:left_join), I get faster, because my tables reach 8 million lines.…
-
3
votes1
answer3255
viewsCalculate difference between dates in days on the R
How do I calculate the difference between dates and have the result in days? I have a column in my table called input with data similar to the ones shown below: Entree 2017-01-27 2017-06-01…
-
3
votes1
answer181
viewsMultiple join on R
I have two tables: dados and dados_aux. I need to add to the table dados the column REGIÃO, present in the table dados_aux. However, I have to use two keys to make the Join: CIDADE and UF.…
-
3
votes2
answers1529
viewsRemove NA in a Data Frame
I import file containing more than 30 columns. A few blank rows that I imported the R recognizes as "NA". When exporting these same columns, the rows that should be blank (empty) appear with "NA".…
-
3
votes2
answers97
views -
3
votes1
answer369
views -
3
votes1
answer182
viewsLower Value of a Set of Columns
I have a set of data and would like to select only the smallest value among each primary key. Follow the example of my DF: ORDEM <- c(1,5,2,3,1,10) GUIA <-…
-
3
votes1
answer223
viewsWidget in Shiny to take a file path
In an application here from work I use the widget below for the user to load a database and it is 'criticized' by another script. fileInput("file1", "Escolha o arquivo", multiple = FALSE, accept =…
-
3
votes1
answer110
viewsCorrplot - How to adjust to the center in Rstudio?
How do I display the center-adjusted corrplot? When executing the command in Rstudio, the graph is displayed very small and positioned to the lower right. corrplot(cor.matrix, method="circle")…