Questions tagged as 'r'

2
answers

How to create a Bubble Plot

Anyone with experience in formulating this chart? I am very much in doubt, especially in the diameter of the circles and in the placement of the X-axis variable. I am a doctoral student at UFPE and many statisticians that I looked for did not kn...
asked by 24.08.2015 / 00:04
1
answer

Ggplot of a Data.frame in separate charts

I have this data.frame: > df ind m X1 X2 1 2015-12-21 21 0.1431529 0.1426365 2 2015-12-21 42 0.1403679 0.1443714 3 2015-12-21 63 0.1467133 0.1466899 4 2015-12-21 84 0.1513388 0.148...
asked by 28.12.2015 / 22:50
2
answers

Does R have any similar commands to SAS IN?

Does R have some similar command to SAS IN? Here is an example in SAS code: IF variable1 IN (4,5,6,7) THEN variable2 = 1; That is, if variable1 assumes values from 4 to 7, variable2 is assigned a value of 1.     
asked by 12.01.2015 / 19:55
1
answer

Merge csv files into one

I have several csv data files that have a common column named "Data". If I read two files from this directory the reading is done correctly: > P1<-read.csv("02650019.csv", header = TRUE, sep = ";") > P2<-read.csv("02650032.csv", he...
asked by 30.01.2015 / 10:52
1
answer

Repetition structure in R

I'm not getting a logic to do the following problem in repetition structure: I have a vector A with 1 element and another B with 30 elements. I wanted to subtract the vector A from each element of B so that this subtraction was accumulated, f...
asked by 18.02.2015 / 04:32
2
answers

Dplyr and gsub: how to replace excerpts from one column to another

I have the following data-frame: xis <- data.frame(x1=c("**alo.123", "**alo.132", "**alo.199"), x2=c("sp", "mg", "rj"), x3=c(NA)) I would like to create a new column using gsub as follows: x3[1] <- gsub("alo", xis$x2[1], xis$x1[1])...
asked by 09.10.2014 / 16:20
1
answer

Rearrange data frame in a list using dplyr in R

This is my dataframe: dput(df) structure(list(ind = structure(c(16437, 16437, 16437, 16437, 16437, 16437, 16437, 16437, 16437, 16437, 16437, 16437, 16437, 16437, 16437, 16437, 16437, 16437, 16437, 16437, 16437, 16437, 16437, 16437, 16437, 1...
asked by 16.09.2018 / 22:29
1
answer

Average repeated lines

People, I have a data.frame as follows Gene 12h 10d 6w Slc39a10 1.52 -6.72 -1.84 Slc39a10 1.52 -6.72 -1.84 Mfsd6 -0.15 0.672 0.26 Mfsd6 -2.55 -...
asked by 16.10.2018 / 20:31
2
answers

Replacing for by Lapply function in R

This is my list lista1<-list(c(1, 2, 3, 4, 5), c(6, 7, 8, 9, 10), c(11, 12, 13, 14, 15 ), c(16, 17, 18, 19, 20), c(21, 22, 23, 24, 25)) I build a new list of the way below. novalista <- vector(mode = "list", length=5) for (i in 1:5...
asked by 27.08.2018 / 03:49
2
answers

Collapsing text in a single line in a database

Suppose I have the following data tabela<-structure(list(nome = structure(c(2L, 9L, 6L, 1L, 8L, 3L, 4L, 5L, 7L, 10L, 11L), .Label = c("12 Anos de Escravidão", "A Caça",...
asked by 02.04.2014 / 18:52