Questions tagged as 'r'

1
answer

How to calculate monthly Cvar in R?

I have downloaded the daily Ibovespa quotes from 01-01-2012 to 12/31/2017 in R. I need to calculate the monthly CVaR of these quotes. I downloaded the Performaceanalytics package, but when I apply it, it calculates the cvar of quotations for the...
asked by 30.03.2018 / 21:50
1
answer

different results using rpart and caret

Hello, I'm testing some regression models and I do not quite understand one thing: I used the rpart package rpart, and then I used the train with rpart method of the caret package resultRPart <- rpart(EVADIU ~ ., data = data.rose) result...
asked by 21.08.2017 / 15:55
1
answer

Degree of class grouping

I have several classes and each of these classes consists of dozens of students, and each year these students change class. So I would like to calculate the degree of grouping that a class keeps from year to year in an automatic way. For example...
asked by 11.09.2017 / 21:59
1
answer

Error RSelenium - Selenium message: Java heap space

Hello, I'm trying to scrape the link using RSelenium because the page only generates the information in the html when it is loaded in the browser. Well when this happens I do not know how to do otherwise than with RSelenium. But when the lo...
asked by 27.09.2017 / 19:23
1
answer

Beta and OR confidence interval

I have a set of data to make the logistic regression of the dependent childbirth variable that is qualitative binary. I use the command below to obtain the univariate logistic model in the R program: GLM.1 <- glm(parto ~ serie, family=bi...
asked by 04.08.2017 / 19:55
1
answer

Select ID vectors with certain characteristics in R

I have a data frame with four columns of values for each ID and I need to create a new df excluding the IDs whose vectors have more than zero or more than one NA. I created the DF library(dplyr) co_entidade<-c(23, 40, 58, 82, 104, 171,...
asked by 24.05.2017 / 20:05
1
answer

POST request with httr not complete (site Fipe table)

I'm trying to get the price data from the Fipe table automatically. Structurally, the information stays in this location: library(httr) library(rvest) url <- "http://veiculos.fipe.org.br/" read_html(url) %>% html_nodes("td") {xml_...
asked by 16.07.2017 / 19:23
1
answer

How do I find the average for a grade? In R

I need to add 2 notes typed to find the final average in R (Nota1 + 2*Nota2)/3 but I do not know how to do the final calculation for the script to work without error print("Escreva seu nome") W<-scan(what="character",nmax=1) print...
asked by 24.08.2017 / 19:13
2
answers

Find a specific row or value of an array vector in R

How to construct a function that evaluates if any line of the mat array is equal to the vec vector both in the code below: set.seed(000) mat <- matrix(rnorm(20),4,5) vec <- c(1.3297993, -0.9285670, 0.7635935, -0.2992151,...
asked by 20.03.2017 / 19:50
1
answer

Contingency table in R

I have a table that boils down to the following: Destino; Proposito; Custo;<br/> Chicago; Negocios; 35;<br/> Nova York; Negocios; 30;<br/> Miami; Turismo; 25;<br/> Chicago; Estudo; 50;<br/> Nova York; Turismo; 40;...
asked by 19.12.2016 / 22:44