Questions tagged as 'data.frame'

1
answer

Data Frame and Linear Regression

With this date frame I need to run some regressions. I want to do regressions with terms that are high to 3 and out of date. I searched the lm package and could not implement it. I want to, for example, rotate the first column in logarithm...
asked by 16.10.2015 / 18:06
2
answers

Compare rows between rows between two data frames?

Considering: q1 <- data.frame(COD = 1:5, CLAS=letters[1:5]) q2 <- data.frame(COD = c(25,1,31,3,2), CLAS=c(45,letters[1],100,letters[3],letters[10])) I need to know which lines are common between the data frames, taking into account th...
asked by 08.08.2016 / 22:57
2
answers

Create a calendar dimension with the month prior to Sys.date

Hello, the script below creates a CSV with a Calendar dimension from year 2015 to the current month. I happen to want the function to return the month before execution. Ex: If Sys.Data records 14/11/2017, it returns the date 10-14-2017. Or, if p...
asked by 14.11.2017 / 19:54
3
answers

Is it possible to pair values from two dataframes with different numbers of observations?

I have two data frames: Sexo <- rep(1:2 , length.out = 51) Estudo <- rep(1: 17, length.out = 51) Salário <- c(runif(51, min=900, max=3000)) data1 <- data.frame(Sexo, Estudo, Salário) data2 <- data.frame(TaxaHomens = c(seq(0.1...
asked by 16.03.2018 / 01:44
2
answers

How to group data by an id in R

I have the following database: id x 1 2 1 3 2 3 3 3 3 3 3 3 I wanted to create a new database without repeating the value of the field id , to solve this I can average the values of field x tha...
asked by 12.04.2015 / 19:19
1
answer

I need to create a column with the ln of a variable in the same data frame

I have a series of data eg GDP and I need to create a column next to it with the variable lnPIB, how do I in R?     
asked by 13.02.2017 / 00:32
1
answer

R Delete rows from the date frame by condition

I have the following data set: Nome <- c("Laetia","Vouacapoua","Lecythis","Pourouma","Poraqueiba","Pseudopiptadenia", "Abarema"); I1 <- c(1,3,3,2,3,3,3); I2 <- c(1,3,1,3,3,3,3); I3 <- c(1,3,1,3,2,3,3); I4 <- c(1,3,2,2,3,3,3) x...
asked by 26.07.2018 / 04:56
2
answers

Select column of a data.frame - division of Database in R

I imported a table as a database to handle in R. However, I need to do some calculations with only a few columns in this table. How do I select only these columns for the calculations?     
asked by 13.07.2017 / 20:24
1
answer

How to filter a data frame?

I have a date frame with 5597 rows and 7 columns. I would like to filter the results of this date frame, so that only the lines in which the second column is written "AC" appear. I tried to use the dr=subset(df, df[2]=="AC") command, wher...
asked by 28.05.2014 / 19:44
1
answer

How can I maintain only specific DataFrame rows?

I have code that goes into a website, fills in a form and pulls a table, however, I want to delete some rows from this table that I do not need. Let's go to the code: #library's require(RCurl) require(XML) require(stringr) require(plyr) req...
asked by 07.03.2017 / 21:05