Questions tagged as 'r'

2
answers

How to do a "rbind" in tables from a SQL base from R?

I would like to "merge" two tables from a SQLite database from the R - and save this into a new table within the same database. Here is a minimum reproducible code: install.packages("sqldf",dependencies=T) install.packages("RSQLite",de...
asked by 18.09.2014 / 02:27
2
answers

Erasing columns containing NA's in their last 5 lines

I have this personal dataframe, set.seed(1) df <- data.frame(A = 1:50, B = 11:60, c = 21:70) head(df) df.final <- as.data.frame(lapply(df, function(cc) cc[ sample(c(TRUE, NA), prob = c(0.85, 0.15), size = length(cc), replace = TRUE) ]))...
asked by 27.09.2018 / 01:00
3
answers

How to put separate ggplot2 graphics, but on the same screen?

Suppose I have these 4 graphics: p1 <- ggplot(mtcars, aes(mpg, cyl)) + geom_point() p2 <- ggplot(mtcars, aes(mpg, cyl)) + geom_line() p3 <- ggplot(mtcars, aes(mpg, cyl)) + geom_line(color="blue") p4 <- ggplot(mtcars, aes(mpg, cyl))...
asked by 26.09.2014 / 02:29
2
answers

Change chr to number in R

My dear, I am trying to convert the data from columns 4 and 5 to number, but it is giving this error. Any suggestion? Thank you in advance! library(tidyverse)dadosarrumados<-data_frame(Região=c("Brasil", "Norte", "Rondônia", "Acre", "Amaz...
asked by 24.12.2018 / 14:14
2
answers

.XLSX file reading in R

What is the problem and / or difference between reading a file in .txt and .xlsx in R ? Reading in .xlsx Can I have more problems than in .txt during an analysis? A friend asked me to do everything in ....
asked by 20.03.2017 / 14:54
3
answers

How to assign NA as value?

I have the following line of code: enem$TP_COR_RACA <- factor(enem$TP_COR_RACA, levels = 0:5, labels = c("Nao", "Branca", "Preta", "Parda", "Amarela", "Indígena")) I want to replace occurrences of the "Nao" value with NA...
asked by 29.03.2017 / 16:58
1
answer

R is not recognizing the csv file separators

I have some files to work with in R, with data in decimal numbers. Files that have separators such as ; are being read correctly, but one of them has , as the border between cells. I do not know how to fix this problem in Linux Ubu...
asked by 27.10.2017 / 14:17
3
answers

Add currency notation in R

I have the following problem here at work: in a data frame I have a column of Gross Value on certain date: 2016-02-01 751434574 2016-03-01 748873781 2016-04-01 755528121 To work on R without problems, but I need to prepare an expense...
asked by 30.06.2017 / 14:21
2
answers

Regular Expression R

I have a variable that indicates the year of elementary school that a student is attending, but this variable was not filled in uniquely. For example, the first year of elementary school because it is indicated as 1º ano , 1º Ano...
asked by 01.08.2017 / 15:54
1
answer

How to make and calculate the frequency distribution table in R?

I'm trying to make the Frequency distribution table in R, however, I'm not getting due to some formulas and calculations that I can not implement in R. The structure of the frequency distribution table is as follows: ---------------------...
asked by 27.06.2017 / 03:16