Questions tagged as 'r'

2
answers

Create sequential counter

I need to create an occurrence count column of a present value in another column. As, for example, count in column "y" of elements present in column "x": x y 1 A 1 2 B 1 3 A 2 4 C 1 5 B 2 6 A 3 Pr...
asked by 20.06.2017 / 15:30
2
answers

Index searches on an R vector

In RStudio how to choose elements of a vector that are in odd or even positions?     
asked by 01.11.2017 / 10:22
1
answer

Extract table from a site to Rstudio

Hello, I want to get the Brazilian table, for example from this site " link " and extract for a dateset in Rstudio, so that whenever the table updates according to the games, it updates itself in rstudio as well. Can you help me?     
asked by 10.10.2017 / 20:38
1
answer

Create a blank data.frame to receive results?

Suppose you want to create a blank data frame to receive the results of an adhesion test. x<-data.frame(Distribuicao=c(NULL),p-value=c(NULL)) After the test, you have a vector with the results: res.ad<-c("Gumbel", 0.9105) To incl...
asked by 01.12.2015 / 16:32
2
answers

Show an object / variable with different names in R?

Considering the following routine: x <- 1:10 for (i in 1:length(x)) { ## Nome da variável: nomevar <- paste0("Var_", i) var <- x[i] + 2 assign(nomevar, var) print(nomevar) # aqui esta minha duvida }     
asked by 07.01.2016 / 17:47
2
answers

How to insert missing dates in a data frame?

I have a 30-year time series of data that has fill-in faults. As noted in the example below, some days were not recorded (1961-08-19-1961-08-20,1961-08-21 ...). How do I identify and insert the missing dates in the "date" column, assigning "NA"...
asked by 29.03.2018 / 15:28
1
answer

Error in generation of graph in R

Hello, I'm trying to create a chart from a list, but I'm not getting it. The downloading part works perfectly: # download adj. price data - Asset[1],Asset[2]... symbols= c("TIET4.SA","BVMF3.SA", "CCRO3.SA","ITUB4.SA","WIZS3.SA")...
asked by 05.03.2018 / 00:32
2
answers

r - sum of one variable in relation to the values of another variable in a data frame

I have a multi-column dataframe. How do I add the values of a column within an element of another variable? I want to do this to summarize the data of each species within each campaign. I have already tried using the summarize function of the pl...
asked by 11.07.2018 / 02:47
1
answer

gif creation in r

I'm trying to create a GIF from the plot below: x<-NULL y<-NULL for(i in 1:500){ y[i]<-sum(rnorm(i))/i x[i]<-i plot(y~x, type="l") abline(y=0) Sys.sleep(0.25) }     
asked by 02.05.2018 / 23:26
2
answers

Cloud of words in R

I'm using the following program: library("wordcloud") library("tm") library("RColorBrewer") dados=read.csv("C:/teste/dados.csv", sep=";", dec=",",header=TRUE) capa=dados$mensagem corpus <- VCorpus(VectorSource(capa)) corpus1 <- tm_m...
asked by 21.02.2015 / 21:05