Questions tagged as 'data.frame'

4
answers

Strategies for analyzing very large databases in R (that do not fit in RAM)

Suppose I have a huge database that does not fit into RAM. What strategies to analyze this database in R, since I can not fully load it into memory? PS: The question is not just about how to make R talk to a relational / non-relational databa...
asked by 28.08.2014 / 06:44
2
answers

Error converting numbers. How to convert factors to numbers?

In the following example: dados <- data.frame(x=c("11", "10", "20", "15"), y=c("25", "30", "35", "40")) dados x y 1 11 25 2 10 30 3 20 35 4 15 40 When trying to transform the variable x into number, instead of 11, 10, 20 15 ap...
asked by 14.03.2014 / 06:32
5
answers

How to consolidate (aggregate or group) the values in a database?

Suppose I have the following database vendas<-c(100,140,200,300,20,1000,200,3000) vendedor<-c("A","B","A","B","C","C","D","A") regiao<-c("Norte","Sul","Leste","Norte","Sul","Norte","Leste","Sul") df<-data.frame(vendedor,regiao,vend...
asked by 27.02.2014 / 02:36
3
answers

How to format a table (data.frame) with publication quality in pdf (latex) in R?

Suppose the following table: tabela <- structure(list(Sexo = structure(c(1L, 1L, 2L, 2L), .Label = c("Homem", "Mulher"), class = "factor"), Grupo = structure(c(1L, 2L, 1L, 2L), .Label = c("A", "B"), class = "factor"), Média = c(0.26550866...
asked by 08.03.2014 / 02:13
2
answers

How to make a conditional graph y ~ x for each factor of the data.frame?

Suppose a data.frame like the following: set.seed(1) dados <- data.frame(w=rep(c("A", "B", "C", "D"), 50), y= rnorm(200), x=rnorm(200), stringsAsFactors=FALSE) How do you create a% s of% s by each category of y~x...
asked by 20.02.2014 / 16:21
4
answers

Create column with sum and percentage of the maximum of other columns

I am a beginner in the R language and wanted to know how I would create a mutate function that would create a new column in my table and at the same time store in that new column the sum of the values contained in the other 6 columns of my table...
asked by 13.02.2017 / 14:35
2
answers

Delete rows containing NA in a data frame

I have a date frame and in the fourth column there are several NA cells. I would like to know how I can delete all lines that have NA. I used this command but they keep showing up dataframe1 r <- with(dataframe1, which(dataframe1[4]==NA, ar...
asked by 28.05.2014 / 00:51
2
answers

Look up values in one data.frame and add in another (R)

I have 2 data.frames, the first is a data.frame that contains stock data and a column with a unique identifier (column "ISIN") , as shown below: > Teste=data.frame(matrix(runif(20), nrow=5, ncol=4)) Teste$ISIN <- c("A1","A2","A3","A4","A5"...
asked by 19.04.2016 / 21:30
1
answer

Are there any R functions similar to Excel's PROCV?

In my case I have two data.frames: > head(Trecho) Xt Yt Zt 1 -75.56468 1.642710 0 2 -74.56469 1.639634 0 3 -73.56469 1.636557 0 4 -72.56470 1.633480 0 5 -71.56470 1.630403 0 6 -70.56471 1.627326 0 > head(TrechoS...
asked by 18.05.2017 / 14:46
2
answers

Create new array from a fairly large first array efficiently

Dear, in R, I have a very large database and I want to create new columns. I will try to explain my problem with a very small matrix. Next, "1" means private school and "2", publishes. I have for example a database >Data Casa Escola 1...
asked by 16.08.2014 / 00:21