Questions tagged as 'r'

1
answer

Add two or more covariates in R

I have a database with multiple IDs (rows) and in the columns the covariates. These covariates are repeated in other columns with different information about the same ID. How to join these covariates using R in a single column and creating more...
asked by 27.03.2018 / 06:05
2
answers

gather multiple with 4 resulting columns "together"

Hi, I have the following situation: I have a data frame with several columns, a group of them I want to turn into key value. So far so good, but there are 2 groups and they can not kinda repeat themselves. Type, is a group of 3 and another...
asked by 14.07.2017 / 22:50
1
answer

Get different values of a column - Data Frame - R Language

Hi, I'm dealing with R in college the first time in my life and I'm completely clueless !! So in a data frame I have a "to" column that has +20,000 values (same and different) What I wanted to know was the different values that appear there a...
asked by 26.11.2016 / 13:30
1
answer

Graph of the Conditional Densities of a Linear Regression

I have this date frame with two columns: Y and X. data=structure(list(Y = c(NA, -1.793, -0.642, 1.189, -0.823, -1.715, 1.623, 0.964, 0.395, -3.736, -0.47, 2.366, 0.634, -0.701, -1.692, 0.155, 2.502, -2.292, 1.967, -2.326, -1.476, 1.4...
asked by 15.11.2016 / 23:08
2
answers

Calculate the output of an operation between two dataframes conditionally

Suppose I have these two dataframes: set.seed(123) df1<-data.frame(rep=rep(1:4,each=360),parc=rep(1:40,each=36),trat=rep(sample(1:10),each=36),tree=rep(1:36,40),med=1,dap_prev=rnorm(1440, mean = 12)) df2<-data.frame(med=rep(1:18,each=10)...
asked by 04.10.2017 / 14:52
1
answer

"Join" two graphs in R

I'm using the igraph library to create two graphs in the R: g.v1 <- graph.full(6, directed= TRUE) E(g.v1)$weight <- 1 g.merchant <- graph.empty(1, directed=TRUE) E(g.merchant)$weight <- 1 This two graphs, g.v1 and...
asked by 06.10.2016 / 15:41
1
answer

https (webservice) request from São Paulo Public Finance

I'm trying to make a https request from the Public Finance Webservice in São Paulo, but I do not know where I'm going wrong. This is the address: link According to the guidance of manual , it is not necessary to authenticate. Basi...
asked by 06.10.2016 / 21:21
1
answer

Text Cleanup and Standardization

I have an Excel table already in the R with two columns (code and company name) and 22,000 rows. The names have been filled out freely, so the same name is written in different forms, abbreviated and in full. I've been able to turn everything...
asked by 16.08.2016 / 20:48
1
answer

Dots (...) with variable title

I need to run a function of type f <- function(...) { l <- list(...) l[["hortela"]] } x <- 'hortela' If we do f(hortela = 1) We have the result 1 , which is what we expect. How do I call f() using x...
asked by 27.02.2017 / 17:10
1
answer

execute .GlobalEnv function in parallel processing

I need to run a function that is in .GlobalEnv in a parallel processing using the multidplyr package. Using a simple example and no parallel processing works as expected: library(dplyr) library(purrr) library(multidplyr) data.frame(x = 1:1...
asked by 21.02.2017 / 19:24