Re: [R] convert microns to nm in a messy dataset [solved]

2019-05-12 Thread Ivan Calandra
Dear Peter, Thank you for your answer, the function na.locf() is exactly what I needed! I had started processing my dataset so the first lines (used as headers) were not included in the sample I have sent. But there is also a "unit" line before the first value. And yes, of course, divide by 1000.

Re: [R] convert microns to nm in a messy dataset

2019-05-12 Thread Ivan Calandra
Dear John, Thank you for your answer. However, it does not make sense to me, as it works only line by line of the data.frame, and I need something for "last observation carried forward" as Peter mentioned. The script does not work as is either, probably due to typos with semi-colons and "if... els

Re: [R] multiple graphs on one plot

2019-05-12 Thread Jim Lemon
Hi Andrew, First, a little mind reading. My crystal ball says that "cw" can be interpreted as "carapace width". It didn't tell me the parameters of the distribution, so: set.seed(1234) mf<-list(rnorm(400,145,15),rnorm(400,160,15)) library(plotrix) multhist(mf, xlab="CW", ylab="Frequency", ylim=c(0

[R] multiple graphs on one plot

2019-05-12 Thread Andrew Halford
Hi Listers I've been trying to make a single graphic that has frequency histograms for male and female mud crabs displayed side by side (such as when using the beside=TRUE command for barplots). I then want to display a normal distribution on top of the male and female histograms. I have been usi

Re: [R] Flip heatmap color range in base R?

2019-05-12 Thread Bert Gunter
?heatmap (carefully!) and note the reference to "col" in the "..." argument (and the need to consult ?image). I suspect that your other questions can be similarly answered by a careful reading of the Help file, but I have not checked. You should. Bert Gunter "The trouble with having an open

[R] Flip heatmap color range in base R?

2019-05-12 Thread Serena De Stefani
I am building a simple heat map in base R. This is my matrix: stleft = matrix( c(0,5,5,2,6,8,4,6,9), nrow=3, ncol=3) colnames(stleft) <- c("Narrow","Wide", "Wider") rownames(stleft) <- c("Person", "Object","Bare") stleft The matrix looks like this: