Questions tagged as 'r'

1
answer

Improve performance for predictive model creation

I'm creating a predictive model in R, using the library caret. When I squeeze in R it takes a long time, and still some errors. In comparison, I run the same base on the Weka in a matter of minutes I already get the result. I have already mod...
asked by 21.02.2017 / 18:30
2
answers

How to assemble models for GLM in R

I would like to make a GLM with the following variables: Variable response: EVI Independent variables: % of forest, edge density, number of fragments, temperature and precipitation. Someone could kindly help me mount the models, I ha...
asked by 10.03.2017 / 01:22
1
answer

Rearrange Row Order dataframe

I have the respective data.frame in the R: Produto Classificação Comum Quilo 1 ABACAXI HAVAI A GRAUDO 3,32 2,2 2 ABACAXI HAVAI B MEDIO 2,81 1,8 3 ABACAXI HAVAI C MI...
asked by 09.03.2017 / 22:30
1
answer

R function returns wrong value

The Log.lik function below returns the value -INF when it should return the value -5836.219 . I can not figure out the error, does anyone have any suggestions? rm(list=ls()) library(ssmrob) data(MEPS2001) attach(MEPS2001) n<-nr...
asked by 08.12.2016 / 20:09
1
answer

Find data from one data frame from the data in another

I have a demand that I can not resolve. The problem is this: I have two tables and I need to find out if there are people in the same table, in case I need to see how much it wins in the second table and transport to the first one (in a new colu...
asked by 09.03.2017 / 14:22
2
answers

How to plot multiple graphs on several different pages using ggplot

I have the following date frame (df): Subject Period Treatment Time Concentration 1 1 1 A -1.000 0.000 2 1 1 A -0.500 0.000 3 1 1 A -0...
asked by 14.11.2016 / 01:44
1
answer

How to make the chart start on the y-axis through ggplot?

Hello, I'm trying to get the chart below to start on the y-axis, but I'm not getting it. The idea is to bring the first value of the x-axis, the time 6h, to the value 0 of the y-axis. Below is the script used and the image obtained. Can an...
asked by 01.12.2016 / 19:47
1
answer

How to combine two dataframes in the correct order using R

df <- read.csv('train.csv') train1 <- train[train$variavel3 == 1] train2 <- train[train$variavel3 == 0] fit1 <- rpart(variavel1~variavel2) fit2 <- rpart(variavel1~variavel2) dftest <- read.csv('test.csv') dftest1 <...
asked by 07.11.2016 / 18:15
1
answer

How to create a variable, averaging another variable from the same dataset?

Imagine I have the following base: Country <- c("Brazil", "Brazil", "Brazil", "Brazil", "Brazil","Brazil", "Argentina", "Argentina", "Argentina", "Argentina", "Argentina", "Argentina") Year <- c(91, 92, 93, 94, 95, 96, 91, 92, 93,...
asked by 07.11.2016 / 18:50
1
answer

Parameter estimation using the optimum function

I'm having a problem in parameter estimation when using the code below: N=1000 m=matrix(ncol=5,nrow=N) mu1=1.2 mu2=1.5 phi1=1 phi2=2 rho=0.5 n=100 truevalue=c(mu1,mu2,phi1,phi2,rho) for (i in 1:N){ U1=rnorm(n,0,1) U2=rnorm(n,0,1) z1=U1*((sqr...
asked by 04.07.2016 / 23:44