Posts by André Oliveira • 376 points
8 posts
-
5
votes3
answers202
viewsQ: 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 the value…
rasked André Oliveira 376 -
5
votes2
answers800
viewsQ: How to convert numbers into categories in R
In my database, I have a Variable TP_CorRaca with the values 0, 1, 2, 3, 4, 5. Each number corresponds to a color. Example: 0 - White 1 - black 2 - brown ... I want to make that match to use the…
rasked André Oliveira 376 -
0
votes5
answers14983
viewsA: How to merge multiple dates frames into one
For those who want a "new alternative". Has the functions: bind_rows(..., .id = NULL) bind_cols(...) combine(...) They’re in the package dplyr which is well worth studying.…
ranswered André Oliveira 376 -
3
votes1
answer419
viewsQ: How do I access a position in a character array?
The following code returns me a vector of 12 letters: res <- "ACDEDEAEDCED" res <- strsplit(res,"", FALSE) View(res[4]) Error in . subset2(x, i, Exact = Exact) : out-of-bounded index More when…
rasked André Oliveira 376 -
2
votes1
answer63
viewsA: Concatenating column when should only read an input
I solved the problem by changing the function read.csv. Follow the line for example: Grup1C0 <- read.csv("~/monografia/Grup1C0.csv", row.names=1, stringsAsFactors=FALSE) The argument is really…
ranswered André Oliveira 376 -
1
votes1
answer63
viewsQ: Concatenating column when should only read an input
I’m using the following code: library(data.table) setwd("/home/andre/monografia/") ; getwd() obj = read.csv(file = "Grup1C0.csv"); tes = obj[4,4] View(tes) The road that is in position [4,4] of the…
rasked André Oliveira 376 -
4
votes0
answers115
viewsQ: Read in blocks do not advance with read.csv. How to fix?
I am trying to make the following code to read a giant file that does not fit the memory. library(dplyr) arq_grande <- file("dados2014.csv", "r") tam_chunk <- 1e2 df1 <-…
rasked André Oliveira 376 -
6
votes2
answers940
viewsQ: Filter 5GB CSV file on R
I am trying in every way to tamper with a 5GB file for my monograph. The code I’m trying to get into is as follows:: > write.csv(subset(read.csv("enem.csv", header=TRUE), UF_ESC=="SP"),…
rasked André Oliveira 376