Questions tagged as 'r'

2
answers

Direct (and beautiful) solution for storing base using dplyr

I have the following default basis: df <- data.frame( lead_15 = c(1,0,0,0,0,1,0,0,1,0,0,0,0,0,1), lead_30 = c(0,0,0,1,0,0,1,1,0,1,0,0,0,1,0), lead_60 = c(0,1,0,0,1,0,0,0,0,0,1,1,0,0,0), inib_15 = c(1,0,0,0,0,0,0,0,1,0,0,0,0,0,0),...
asked by 16.02.2017 / 20:31
1
answer

how to put the histogram values at the top of the bar

I'm using the histogram command from the lattice library in R. I would like to know how I can put the value on top of the bars, value that I tell is the histogram count. Ex:     
asked by 01.04.2018 / 02:34
2
answers

Select multiple rows from a data.frame, from the largest values R

I have the following date.frame in R: df <- data.frame(x = c(10,10,2,3,4,8,8,8), y = c(5,4,6,7,8,3,2,4)) df x y 1 10 5 2 10 4 3 2 6 4 3 7 5 4 8 6 8 3 7 8 2 8 8 4 First point : I would like to get all rows conta...
asked by 13.06.2017 / 18:56
2
answers

Pulling elements from one list to another under a criterion in R

The vector below indicates the regressions that I have circled. regression_pairs=c("A~B", "C~D", "E~F", "G~H","I~J","K~L","M~N","O~P","Q~R") regression_pairs Below is the list where I saved the remainders of each regression residuals.ne...
asked by 22.08.2018 / 01:42
1
answer

Schedule automatic updates in R

I have an algorithm in the R designed that retrieved data from a database, does some statistical calculations and produces a dashboard with kpis and graphs generated from those calculations. But, every time I want to update the information, I ha...
asked by 17.07.2017 / 01:58
3
answers

function in R which also returns the execution time itself

I know there is Rprof (), but it seems rather inaccurate compared to the microbenchmark (). However, if I want to use the microbenchmark () I have to call the function 2 times, one to have the output of it and another to run the time of it (whic...
asked by 02.06.2018 / 23:42
1
answer

overlapping histrograms

Good morning. I would like to create a histogram with 26 species on the x-axis and the percentage of commercial hunting influence on the reduction of each species (column '' depletion_rate '') on the y-axis. I would also like to overlap the histo...
asked by 13.12.2018 / 15:27
1
answer

Calculation Probabilities T-Student in the R

I have the mean and standard deviation of my distribution: mean = -0.49 ; sd=3.029041 How do I calculate the probability of y being a standard deviation below the mean using T-Student with 85 degrees of freedom? Would it be:...
asked by 30.10.2016 / 20:21
1
answer

Import data from the central bank into the R

I wonder if it is possible and how to import data from the central bank direct to the R If there is any specific api or package to access the time series     
asked by 15.12.2017 / 17:00
2
answers

Play a chart in the R

I made chart 1 below in R, from the code: library(truncreg) set.seed(1) x <- sort(rnorm(50)+3) y <- 3 + 1*x + rnorm(50,0,0.3) compl <- data.frame(x,y) y[y>6.5] <- 6.5 sample <- data.frame(x,y) pred.OLS <- predict(...
asked by 26.06.2017 / 01:40