[R] pheatmap - clustering of select columns

2019-03-08 Thread Adrian Johnson
Dear group, In pheatmap, is it possible to cluster select colmns. For example, in a matrix of 10 rows and 20 columns. I want to cluster only those columns 1-10 and cluster rows. Similarly, retaining the same row clustering resulted from clustering of columns 1-10, I want to enforce clustering of

Re: [R] Common elements

2019-03-08 Thread Rui Barradas
Hello, If I understand correctly, here are two different ways of doing what you want. 1) base R. i <- duplicated(df1[[2]]) j <- duplicated(df1[[2]], fromLast = TRUE) res <- df1[i | j, ] res[order(res[[2]]), ]# not strictly needed 2) with package dplyr. If you do not want to order by

Re: [R] Common elements

2019-03-08 Thread Doran, Harold
Do you mean like this? tmp <- data.frame(v1 = c(1,2,1,4,2), v2 = c(10, 11, 10, 14, 11)) vals <- paste(tmp$v1, tmp$v2, sep ='') tmp[which(vals %in% vals[duplicated(vals)]),] On 3/8/19, 12:51 PM, "Silvano Cesar da Costa" wrote: >Hi, > >I have a dataset with ten columns, but I need extract only

Re: [R] Common elements

2019-03-08 Thread Jeff Newmiller
This request is quite unclear. Can you make a reproducible example [1][2][3] and provide data that represents the expected result corresponding to the input data? The dput function is much much better than tabular form for this purpose. For one thing, you mention ten columns, but they are not

[R] Common elements

2019-03-08 Thread Silvano Cesar da Costa
Hi, I have a dataset with ten columns, but I need extract only lines that has common elements. The columns are: Animal Mother [1,] 1143430 [2,] 1144134 [3,] 1146 3 [4,] 1147151 [5,] 1150230 [6,] 1156290 [7,] 1157227 [8,] 1159757

[R-es] Partial Dependence Plots

2019-03-08 Thread Manuel Mendoza
Buenas tardes erreros, tras aplicar randomForest, aplico partialPlots ¿sabéis como estandarizar los PDPs de las distintas variables (para poder comparar sus efectos), o que me los represente para un mismo rango de y? Me parece recordar haberlo visto, pero en la documentacion de

Re: [R] rounding off problem.....

2019-03-08 Thread Kevin Thorpe
I'm no expert in R internals or floating point computation, however, two things come to mind. First, I suspect the exact value is stored. It is just the printing that looks rounded. That is likely because 0.001 completely dominates the rest. To print in full precision, you would need over 200

Re: [R] rounding off problem.....

2019-03-08 Thread Eric Berger
"Is there any way ..." Two quick answers: 1. using base R functions and data types the answer is 'no' - a double (i.e. numeric) contains about 15 significant digits. So 5.678e-100 is fine but 0.01 + 5.678e-100 will keep the .0100 as the significant digits and "drop" the digits

Re: [R-es] Crear una variable tipo factor a partir de un vector de caracteres

2019-03-08 Thread Antonio Rodriguez Andres
Aqui adjunto el código que finalmente funcionó, por si alguien pudiera necesitarlo en el futuro en la lista func1 <- function(x){ ifelse(x %in% ca, "Central Africa", ifelse(x %in% ea,"East Africa", ifelse(x%in% sa, "South Africa", ifelse(x%in% wa, "West Africa", ifelse(x%in% na, "North