Questions tagged as 'r'

1
answer

R - how to sample pairs from a vector without repeating values?

I'm trying to create 100 pairs from a vector with 200 values. I have constructed a vector following a normal distribution as follows: vetor=rnorm(200,mean=30,sd=6) And now I want to extract 100 pairs of these values, but without repeating a...
asked by 10.02.2018 / 19:26
1
answer

How to generate a sequence of dates in r?

How do I generate a list with dates, for example, starting in 2011-07-01 and ending in 2011-10-31?     
asked by 11.10.2017 / 18:55
1
answer

Best SQL DBMS for large databases (RAIS RAM mem)

I'm trying to write a routine to automate the import of public RAIS micro-data and to work with them on a regular computer (RAIS size & RAM) What is the best SQL software (DBMS / protocol) to use? Preferably I would like to use RSQLlite becau...
asked by 03.10.2014 / 03:18
3
answers

How to put several formats in the points of my PCA by ggplot2

I would like to put different shapes in the graph points of a PCA generated by ggplot2 for example (masculinos = square, feminine = triangle ...).     
asked by 17.02.2017 / 03:34
2
answers

Weighted Average in R

With the dataset I have the columns c1 (year), c2 (states), c3 (weight) and c4 (value). I would like to make the weighted average of (c4) with (c3), by state (c2) per year (c1). dados <- data.frame(c1 = c(rep(1996:2003, 4)), c2 = c(rep(...
asked by 06.12.2018 / 02:20
1
answer

Cluster Analysis by Groups

I'm trying a cluster analysis for multiple groups within a dataframe, in order to return the characteristics of this analysis (ex the resulting groups) into a database using the function tidy ( broom ). dput dataset=...
asked by 21.11.2018 / 19:11
1
answer

In a matrix Z of elements (i, j) how to assign the value 1 when i = j? (software R)

By the following condition: ifelse(??, 1, Z/(1+1)) What to put in place of "??" so that R understands that when i = j in the matrix Z, I want to assign the value 1?     
asked by 17.06.2017 / 03:38
1
answer

Reverse factors in only 1 bar in ggplot2

Does anyone have any idea how to order the factors in just 1 bar in ggplot2? Reorder data no longer works: ( In case I would like to invert the first bar, so that the green one stays up and the red one down. library(ggplot2) dados <...
asked by 12.06.2017 / 20:23
2
answers

Is there a function that checks if a certain value is contained within a certain range?

Assuming that: x=120,00 limites.inferior<-80 limites.superior<-160 limites<-c(limites.inferior,limites.superior) I'm doing this with a logical test: x.int<-x>=limites[1] && x<=limites[2] Is there a function th...
asked by 15.03.2016 / 04:02
1
answer

Divide data frame by the first line of itself

I'm trying to create an index number from a data frame. I would like to divide each column by the first number without having to divide it column by column. Just as an example, df would be: DF1 <- data.frame(Name = c("Aaron", "Blake"), J...
asked by 09.11.2018 / 21:59