Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Several people have said they would, or have, ploted histograms - but how?

* By hand?

* With Excel?

* With R?

* With processing?

I'm a little sad to see that this item has been flagged heavily, but I guess there are people who think this is sufficiently off-topic that it should be in the same category as spam.



use R

#copy data into a txt file without the first two lines from the xls

par(mfrow = c(3,2))

dat <- read.table("data.txt", sep="\t", header = TRUE)

for(let in c("A","B","C","D","E","F"))

plot(density(dat[,let]), main = let)

easy...(why doesnt HN recognise newlines?)


why doesnt HN recognise newlines?

It treats single newlines as the same paragraph and double newlines as a new one. Alternatively, if you want to post code, you can indent it by four spaces. Like this:

    par(mfrow = c(3,2))
    dat <- read.table("data.txt", sep="\t", header = TRUE)
    for(let in c("A","B","C","D","E","F"))
    plot(density(dat[,let]), main = let)


Thanks Dove. I probably should read the posting FAQ or something.


Not your fault, actually. That particular quirk may be written down somewhere, but I've not found it in my three years here.

I offer you knowledge obtained by sheer trial and error. :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: