Questions tagged as 'r'

1
answer

How to filter a data frame?

I have a date frame with 5597 rows and 7 columns. I would like to filter the results of this date frame, so that only the lines in which the second column is written "AC" appear. I tried to use the dr=subset(df, df[2]=="AC") command, wher...
asked by 28.05.2014 / 19:44
2
answers

Connecting points to the regression line in 3d

This is the 3d version of this other question. Consider the following data: Income2<-structure(list(X = 1:30, Education = c(21.5862068965517, 18.2758620689655, 12.0689655172414, 17.0344827586207, 19.9310344827586, 18.2758620689655, 1...
asked by 06.04.2014 / 05:19
1
answer

Poorly calculated coefficients in Linear Regression in R due to NA's

This is my dataframe: structure(list(Year = c(1979L, 1979L, 1979L, 1980L, 1980L, 1980L, 1981L, 1981L, 1981L, 1982L, 1982L, 1982L, 1983L, 1983L, 1983L, 1984L, 1984L, 1984L, 1985L, 1985L, 1985L, 1986L, 1986L, 1986L, 1987L, 1987L, 1987L, 1988L...
asked by 30.08.2018 / 21:33
1
answer

How to validate a CPF using a function in R? [closed]

I'm trying to improve the @Rui Barradas code that is posted here as a response, but the same does not work for some situations. After debugging the code, I understand that the problem is in the cpf_validar function, since cpf_dig_con...
asked by 09.10.2018 / 04:34
1
answer

How do I execute the str_detect (stringr) function for more than one variable at a time?

I want to filter my database based on two variables: via and city . This filter, however, is done by means of case particles present in these two variables. For example, I want to analyze who took the first route ( 1via ) and...
asked by 16.10.2018 / 04:23
1
answer

Export multiple .csv files to R

I'm trying to export multiple files .csv to R through the lapply function. These files are within a list. I've tried the following settings: lapply(list,function(x) write.csv2(list$x,paste0(x),row.names=FALSE)) lapply(seq_along(...
asked by 27.10.2018 / 22:04
1
answer

Make variables created with lapply allocated in their respective dataframe within a list

I use the lapply function and want the results to return within their respective dataframe within the list. Consider the following function: x<-lapply(list,function(x)paste(x$Sigla,x$Município,sep='')) # onde 'Sigla' e 'Município'são...
asked by 01.10.2018 / 21:13
1
answer

How to create a command to choose linearization alternatives

I have the following command to get coefficients for linearisation of the Michaelis Menten function. # "Estimativas para "CHUTE" # 1 para (Eadie-Hofstee y = -B(y/x) + A)(Especialmente para RMSEA com valores nulos) # 2 para (x = A(x/y) - B)...
asked by 28.09.2018 / 21:06
1
answer

Problem in organizing a dataframe with tidyr in R

I have this dataframe and I need to organize it so that the unique dates are the first column and the columns are the shares of bovespa with their values being their respective prices: df<-structure(list(data = structure(c(1L, 1L, 1L, 1L, 1...
asked by 26.09.2018 / 23:34
1
answer

Random choice of rows in an array in R

I have a problem that gives me a numeric matrix mxn where m is the number of observations (row) and n the number of variables (column). I need to randomly choose p rows (p < m) without replacement from that array. So I will create a p x n mat...
asked by 17.04.2018 / 03:04