search for: names_to

Displaying 12 results from an estimated 12 matches for "names_to".

2024 Jun 12
1
my R code worked well when running the first 1000 lines of R code
...> For conflicting issue, > > What I tried was to add dplyr::pivot_longer or tidyr:: pivot_longer, Do that to all functions comming from contributed packages. At least to those. summary_anno1148ft <- anno1148ft %>% tidyr::pivot_longer(c(t_depth, t_alt_count, t_alt_ratio), names_to = "measure") %>% dplyr::group_by(dat, measure) %>% dplyr::summarize(minimum = min(value,na.rm=T), q25 = quantile(value, probs = 0.25,na.rm=T), med = median(value,na.rm=T), q75 = quantile(value, probs = 0.75,na.rm=T),...
2024 Dec 10
1
Heat maps containing two types of variables
...lp. Philip # REPREX library(ggplot2) library(tidyr) library(dplyr) dat <- data.frame( date=seq.Date(as.Date("2024-01-01"),as.Date("2024-06-01"),by="month"), A=c(1,3,3,4,2,6), B=c(3,5,6,4,8,9), C=c(10,8,17,19,26,22) ) dat_long <- pivot_longer(dat,2:4,names_to="variable",values_to="value") normalize <- function(x) { y <- (x-min(x))/(max(x)-min(x)) } dat_norm <- mutate(dat,across(2:4,normalize)) dat_long_norm <- pivot_longer(dat_norm,2:4,names_to="variable",values_to="norm_value") dat_long <- inner_j...
2024 Jun 12
1
my R code worked well when running the first 1000 lines of R code
...For conflicting issue, > > What I tried was to add dplyr::pivot_longer or tidyr:: pivot_longer, Do that to all functions comming from contributed packages. At least to those. summary_anno1148ft <- anno1148ft %>% tidyr::pivot_longer(c(t_depth, t_alt_count, t_alt_ratio), names_to = "measure") %>% dplyr::group_by(dat, measure) %>% dplyr::summarize(minimum = min(value,na.rm=T), q25 = quantile(value, probs = 0.25,na.rm=T), med = median(value,na.rm=T), q75 = quantile(value, probs = 0.75,na.r...
2024 Jun 12
3
my R code worked well when running the first 1000 lines of R code
...hed. However, after running another 2000 lines of R codes using functions from more than 10 other R libraries, then it only generated one column of summary. Do you know why? Thank you, Yuan Chun Ding summary_anno1148ft <- anno1148ft %>% pivot_longer(c(t_depth, t_alt_count, t_alt_ratio), names_to = "measure") %>% group_by(dat, measure) %>% summarize(minimum = min(value,na.rm=T), q25 = quantile(value, probs = 0.25,na.rm=T), med = median(value,na.rm=T), q75 = quantile(value, probs = 0.75,na.rm=T), maximum = max(value,na.rm=T)...
2024 Jun 12
1
my R code worked well when running the first 1000 lines of R code
...hed. However, after running another 2000 lines of R codes using functions from more than 10 other R libraries, then it only generated one column of summary. Do you know why? Thank you, Yuan Chun Ding summary_anno1148ft <- anno1148ft %>% pivot_longer(c(t_depth, t_alt_count, t_alt_ratio), names_to = "measure") %>% group_by(dat, measure) %>% summarize(minimum = min(value,na.rm=T), q25 = quantile(value, probs = 0.25,na.rm=T), med = median(value,na.rm=T), q75 = quantile(value, probs = 0.75,na.rm=T), maximum = max(value,na.rm=T)...
2023 May 02
1
Reg: Help regarding ggplot2
...ata using dput in future: saves us having to do something like that to reclaim it! ### pivot that longer to make it easy to get country data as separate lines data_vol3 %>%? select(-rowN) %>% ? pivot_longer(cols = -index, # as you want to pivot the other variables/columns ?????????????? names_to = "countries") -> tibDataVol3Long ggplot(data = tibDataVol3Long, ?????? aes(x = index, y = value, ???????????? ### now get the grouping and use it for a colour legend ???????????? group = countries, colour = countries)) + ? geom_line() > Any help in this regard will be highly...
2024 Jun 12
1
my R code worked well when running the first 1000 lines of R code
...of R codes using functions from > more than 10 other R libraries, then it only generated one column of > summary. > Do you know why? > > Thank you, > > Yuan Chun Ding > > summary_anno1148ft <- anno1148ft %>% > pivot_longer(c(t_depth, t_alt_count, t_alt_ratio), names_to = "measure") > %>% > group_by(dat, measure) %>% > summarize(minimum = min(value,na.rm=T), > q25 = quantile(value, probs = 0.25,na.rm=T), > med = median(value,na.rm=T), > q75 = quantile(value, probs = 0.75,na.rm=T), >...
2023 Oct 31
1
weights vs. offset (negative binomial regression)
...low. > > ? ?cheers > ? ? Ben Bolker > > > edata <- data.frame(Catch, Effort, xx1, xx2, xx3) > > ## graphical exploration > > library(ggplot2); theme_set(theme_bw()) > library(tidyr) > edata_long <- edata |> pivot_longer(names_to="var", cols =-c("Catch", > "Effort")) > ggplot(edata_long, aes(value, Catch)) + > ? ? ?geom_point(alpha = 0.2, aes(size = Effort)) + > ? ? ?facet_wrap(~var, scale="free_x") + > ? ? ?geom_smooth(method = "glm", m...
2023 May 02
5
Reg: Help regarding ggplot2
Dear All, I have a dataset which contains date and 12 other countries data. I have extracted the data as xts object. I am not able to recall all the series in the Y axis. My data set looks like this index crepub finland france germany italy netherlands norway poland <date> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
2025 Mar 29
2
Setting up hypothesis tests with the infer library?
How about calculating a 95% confidence interval about the estimated proportion in favor. The PooledInfRate package will do this for you. If confidence intervals overlap then there is no significant difference. -----Original Message----- From: R-help <r-help-bounces at r-project.org> On Behalf Of Kevin Zembower via R-help Sent: Saturday, March 29, 2025 12:10 PM To: R-help email list
2023 Apr 04
1
Simple Stacking of Two Columns
Just to repeat: you have NamesWide<-data.frame(Name1=c("Tom","Dick"),Name2=c("Larry","Curly")) and you want NamesLong<-data.frame(Names=c("Tom","Dick","Larry","Curly")) There must be something I am missing, because NamesLong <- data.frame(Names = c(NamesWide$Name1, NamesWide$Name2)) appears to
2024 Jun 28
1
Ayuda para hacer una lista
Hola, que tal? Sin saber nada mas de los datos, por lo que dices, mi aprioximacion seria usar la funcion split, e.g.: splittedData <- split(myData, "variablegrupo/condicion") Esto te crearia una lista con tantos objectos como condiciones tengas. Saludos On 6/27/24 10:15, Leticia G Leon wrote: > Muchas fracias por la rapida contastacion Javier. > > Si, ya me he dado