Questions tagged as 'data.frame'

2
answers

counter function of reshape2 :: melt (tear)

I'm working with data.frame and it's organized in long format. But I'd like to put it in wide format based on a variable ( FAT2 ) such that the column layouts would be: AVA , FAT1 , Banana , Ingá , Gliricí...
asked by 10.12.2018 / 15:51
1
answer

How to delete repeated values in a text column in R?

I have a data.frame that has a column with names, but these names repeat a few times. I need to create a new column in a new data.frame with all names, but no repeats.     
asked by 01.06.2017 / 20:17
1
answer

How to change the class of a variable inside a table / data frame / tibble?

I have a table called tab01 with the following variables (columns) and their respective classes in parentheses: uf (character), regiao (character), ano (double) and pop (double ). I want, inside the table:...
asked by 27.06.2017 / 21:03
1
answer

Calculating rates in R

I have the following dataframe: data <- data.frame(Individuo=c("1","2","3","4","5","6"), Sexo=c(2,4,4,2,4,2),Ocupaçao=c(1,1,2,2,1,2), Raça=c("Branco","Negro","Pardo","Branco","Pardo","Branco"), Estudo=c(10,12,14,16,13,11)) Where,...
asked by 13.03.2018 / 21:03
1
answer

How to join two data.frames in R with different variables and out of order?

I have two data.frames: frame1 <- data.frame(dia=c("02/01/2017","03/01/2017","04/01/2017","05/01/2017"), y=c(2,2,1,2),w=c(4,4,2,2),z=c(25,16,24,30), k=c("sim","nao","sim","nao")) frame2 <- data.frame(dia=c("05/01/2017","04/01/2017","03/0...
asked by 30.12.2017 / 03:32
1
answer

Date frame manipulation

Hello, I'm trying to manipulate a database with 300+ observations, but each observation has a different number of columns. The problem is that from a certain point, the columns start repeating themselves, but they have different values and I...
asked by 28.03.2018 / 21:08
1
answer

How to pass my dataset from wide format to long cm in multiple variables in R

I have the following date frame: dput(exemplo) structure(list(id = c(1, 2, 3, 4, 5, 6, 7), grupo = c("A", "A", "A", "B", "B", "B", NA), fc_pre = c(90, 98, 77, 98, 100, 92, 89), fc_pos = c(70, 77, 77, 70, 79, 72, 76), pa_pre = c...
asked by 24.08.2017 / 05:20
1
answer

Return in a DataFrame - Python

Good afternoon. I have a question regarding Python. I have an if where has the conditional and else, the else it processes more than one file and I need to save all the information it reads inside a DataFrame, is there a way to do this? The c...
asked by 22.05.2018 / 20:43
2
answers

read.table, data.frame

I try to perform this section below and it occurs: rain.df<-read.table("C:\Users\Marcia\Desktop\Sript R\daily.dat", header=TRUE)    Error in scan (file = file, what = what, sep = sep, quote = quote, dec = dec,:    line 3572 did not have...
asked by 22.08.2017 / 20:30
1
answer

How to test multiple data.frames and establish a maximum score of the tests for a certain position? #R

Given the following data.frames: library(zoo) A<-data.frame(x1=(0:9),x2=rep(0:1,5),x3=rep(0:4,2)) B<-apply(A, 2, function(x) rollapply(x, width = 2, FUN = sum, fill = NA, align = 'r', na.rm=TRUE)) C<-apply(A, 2, function(x) rollap...
asked by 01.02.2016 / 08:30