Posts by neves • 5,644 points
165 posts
-
2
votes1
answer1036
viewsA: Use the VIF test
For the implementation of VIF (Variance inflation factor), in a regression analysis, do: dataset<-data.frame(v1=c(4,5,5,5,6,7,6,6,7,7),v2=c(5,6,6,4,3,2,4,5,6,7),v3=c(4,5,6,6,7,8,5,6,6,7))…
-
0
votes3
answers559
viewsA: Compare columns of a dataframe with those of others and remove columns that are not common between them
Another function would be: result<-Reduce(function(x,y)intersect(x,y),list(colnames(df1),colnames(df2),colnames(df3),colnames(df4),colnames(df5))) where you can compare how many dataframes you…
-
2
votes3
answers559
viewsA: Compare columns of a dataframe with those of others and remove columns that are not common between them
An add-on to the @Fernandes response is given below: list<-list(df1[idem_cols],df2[idem_cols],df3[idem_cols]) list # cria uma lista com as colunas comuns dos dataframes > list [[1]] x2 x4 1…
-
2
votes2
answers163
viewsA: Interpolation of decimal numbers in R
If you prefer, round these numbers to the nearest integer with the function round: x<-c(191.1, 191.48, 191.87) x #[1] 191.10 191.48 191.87 round(x,0) # onde 0 é o número de casas decimais #[1]…
-
1
votes3
answers559
viewsQ: Compare columns of a dataframe with those of others and remove columns that are not common between them
Suppose I have 3 dataframes. In them, I have various columns (e.g. X1, x2..., Xn). However, not all these columns coexist in all dataframes. My goal is to compare these dataframes and leave, EACH OF…
-
2
votes2
answers160
viewsQ: Renaming all Environment objects with a specific name
The Environment is: but I want to convert into: where dataset is the specific name.…
-
2
votes1
answer128
viewsA: Error in package topicmodels
On the R, do: install.packages('tm') install.packages('topicmodels') If this does not work, open the terminal (Ctrl+Alt+T) and run: sudo apt-get install gsl-bin libgsl2 and then sudo apt-get install…
-
1
votes3
answers1792
viewsA: Columns with numbers of different rows, how to join?
Execute: x<-c(1:9) y<-c(1:10) library(qpcR) qpcR:::cbind.na(x,y) or qpcR:::rbind.na(x,y) # para linhas
-
5
votes2
answers96
viewsQ: Convert a list with different line dataframes into independent dataframes
I have a list with 3 dataframes, which derive from the function split: > split $`1` bin group1 group2 missing score1 score2 gender size score3 income city 0 1 1 NA 3 2 M S 4 1605.525 San…
-
3
votes2
answers97
views -
3
votes2
answers97
views -
5
votes2
answers651
viewsQ: How to perform the tapply function for multiple dataframes in R?
I wish to perform only ONE function tapply and get results for each of the dataframes at once: dataset1<-data.frame(group = rep(c('a','b','c','d'), 3, each = 3), number1 = c(1:36), number2 =…
-
4
votes2
answers711
viewsQ: Issue discriminant function constant - linear discriminant analysis [R]
How to issue the discriminant function constant (or constants, if multiple discriminant analysis)? Follows the dput for assistance in response. structure(list(REAÇÃO = structure(c(0, 1, 0, 0, 1, 0,…
-
1
votes1
answer832
viewsQ: How to insert a legend on a map in R?
I did a cluster analysis k-Means fictitious. I want to create a caption (cluster1, cluster2 and cluster3), which is represented by the variable "kmeans" (formed clusters). I do not know if it would…
-
3
votes1
answer761
viewsQ: How to transpose rows into columns (and vice versa) and save to a new database?
My database has 10 cases and 6 variables. I want to transpose the cases in column and save this transposition in a database.