[R] Getting an error calling MASS::boxcox in a function

2023-07-08 Thread Ron Crump via R-help
Hi, Firstly, apologies as I have posted this on community.rstudio.com too. I want to optimise a Box-Cox transformation on columns of a matrix (ie, a unique lambda for each column). So I wrote a function that includes the call to MASS::boxcox in order that it can be applied to each column easil

Re: [R] How to set colors, axis gap, and free scale in ggplot?

2022-02-22 Thread Ron Crump via R-help
ry function supplied, defaulting to `mean_se()` Warning messages: 1: Ignoring unknown parameters: fun.y 2: Removed 24 rows containing non-finite values (stat_summary). 3: Removed 24 rows containing non-finite values (stat_summary). 4: Removed 24 rows containing missing values (geom_point). On Tue,

Re: [R] geom_text only in the first panel with facet_wrap in ggplot2

2018-06-25 Thread Ron Crump
Dear Maria, I am trying to add text only in the first panel of a faceted ggplot The following might help you to achieve what you want. I created a small dummy dataset, but I tried to use your column names in the hope this would help: library(ggplot2) # data.frame DF <- data.frame(Q = rep(1:5,

Re: [R] Overlay line on a bar plot - multiple axis

2018-04-30 Thread Ron Crump
Hi Miluji, Using Jim's interpretation of your desired graph, you could do it in ggplot2 using your dat DF by: ggplot() + geom_bar(data=dat, aes(x=week,y=count,fill=city),stat="identity",position="dodge") + coord_flip() + geom_line(data=dat, aes(x=week, y=mean_tmin)) There would still need

Re: [R] read a file of text with read.table

2014-06-26 Thread Ron Crump
Hi Carol, It might be a primitive question but I have a file of text and there is no separator between character on each line and the strings on each line have the same length. The format is like the following absfjdslf jfdldskjff jfsldfjslk When I read the file with read.table("myfile",colCl