Re: [R] apply a color range (kind of like a heat map) to the values in each cell of a data frame

2021-06-17 Thread Jim Lemon
Hi Ding, There are a number of "value to color" functions in various packages. One is "color.scale" in the plotrix package: library(plotrix) s1 <-c(0.085,0.086,0.139,0.129,0.235,0.177,0.000,0.126,0.271,0.000,0.083,0.163) s2

[R] apply a color range (kind of like a heat map) to the values in each cell of a data frame

2021-06-17 Thread Yuan Chun Ding
Dear R users, I have a numeric table with 140 rows and 30 columns, here I only made partial table, test1, as an example. I want to apply a blue color range to the value in each cell of the data frame test1. I found some R code using DT library. However, I only can see the colored table at

Re: [R-es] problemas para agrupar cadenas en una sola con str_replace_all

2021-06-17 Thread juan manuel dias
muchas gracias! no encontraba la solución de la forma que me passaste! lo pude resolver de este modo: cat_uno <- c("consultorio","consultorio externo","consultorio externos de cp", "consultorios cuidados paliativos","consultorios externos cuidados paliativos",

Re: [R] Legend position in ggplot

2021-06-17 Thread Felipe Carrillo via R-help
Like this? theme(legend.position= 'top' On Thursday, June 17, 2021, 10:52:04 AM PDT, peri He wrote: Dear Friends, I would like to see my legend outside of a ggplot (at the top). This code is showing the legend inside of a plot: theme(legend.position=c(0.15,0.97)) But when I changed

[R] Legend position in ggplot

2021-06-17 Thread peri He
Dear Friends, I would like to see my legend outside of a ggplot (at the top). This code is showing the legend inside of a plot: theme(legend.position=c(0.15,0.97)) But when I changed it to : theme(legend.position=c(-0.15,1.5)) , the legend disappears. I would appreciate it if you share your

[R] Potential Bug: file.show does not support double-byte characters in the file path

2021-06-17 Thread Tim via R-help
Hi, I may have come across a bug regarding the file.show function in the base package. ### Bug Description file.show does not support double-byte characters in the file path. ### Platform Info > sessionInfo() R version 4.1.0 (2021-05-18) Platform: x86_64-w64-mingw32/x64 (64-bit) Running

Re: [R] Can't add error bars to existing line graph

2021-06-17 Thread Jim Lemon
Hi Bruno, The interaction.plot function plots the _levels_ of the x.factor argument, not the values of the variable that is coerced to a factor. This means that the temperature locations on the x axis are c(1,2), not c(12,17). The code below works for me: