Questions tagged as 'r'

2
answers

How to sort the x-axis boundaries in ggplot?

I have the following data: k <- c(294131, 734127, 817963) ano <- c(1991, 2000, 2010) dados <- data.frame(k, ano) I'm doing it this way: ggplot(dados,aes(x=ano,y=k)) + geom_point() + geom_line() + scale_x_continuous(limits=c(1991,...
asked by 28.10.2014 / 18:20
1
answer

How to count different rows in R

I have the following table: Material Fornecedor 1 A 1 B 1 A 1 C 1 C 2 B 2 D 2 E 3 A 3 B 3 C 3 F 3 G 3 A 4 A I need to create a new column of 1 and 0 where 0 will indicate that that vendor has already appeare...
asked by 29.06.2017 / 20:45
1
answer

Calculate covariance matrix in R

Given an array whose elements are values of a given attribute in n positions in space. How to calculate the covariance matrix (nxn) of the values of this attribute in given positions?     
asked by 28.06.2017 / 20:47
1
answer

Using If / Else in R

This is my data frame: tsdata=structure(list(S.Educ = c(228.3000255, 237.2500067, 248.2500235, 235.8500022, 243.3000045, 254.9999758, 258.1000174, 261.1000144, 268.3000056, 277.1000373, 249.2000057, 234.7000229, 239.8500266, 0.66159, 0.6745...
asked by 04.04.2017 / 01:21
2
answers

Error reading a file: Error in scan line 6 did not have 63 elements

I'm new to R and can not read the file I'm working with. tab1<-read.table("savedrecs.txt", header=T, sep="\t") Error in scan(file = file, what = what, sep = sep, quote = quote, dec = dec, : line 6 did not have 63 elements     
asked by 04.04.2017 / 18:49
1
answer

Using MySQL with the R in the RMySQL package

I'm new to MySQL and I installed this program to use with R. I was able to install the RMySQL library, following the tutorials I found on the internet and the course I'm doing at Coursera as link and link I even tried to install an...
asked by 02.06.2017 / 21:18
1
answer

Integration between R and Java

I'm working on a project and I have to integrate the language R with Java . Could you help me by indicating a good library or a Hello World code that does this integration?     
asked by 12.07.2016 / 21:04
1
answer

Return of the gradient function when using Optim functions and colSums

I can not understand why when I use the gradlik function as the argument of the Optim function I get the following error: Error in optim(beta, loglik, gradlik, method = "BFGS", hessian = T, control = list(fnscale = -1)) : gradie...
asked by 21.12.2016 / 03:08
1
answer

How to make maps in R with parallel processing?

I have tried to make multiple maps at the same time in R using plot and parallel processing using the snowfall package. I have done the following function mapas : mapas <- function (tx, limite) {...
asked by 21.07.2016 / 22:03
1
answer

R: Name vector within a for

I'm doing a for in my script, but in the last line when I run models$i , I needed that i to be the value of my i of for , how would I do it? for(i in x){ maxit <- as.integer(1000000) algoritmo <-...
asked by 31.01.2017 / 01:07