Re: [R] as.data.frame doesn't set col.names

2017-10-25 Thread Duncan Murdoch
On 25/10/2017 8:15 AM, Eric Berger wrote: Hi Peter, Thanks for contributing such a great answer. Can you please provide a pointer to the documentation where it explains why dd$B <- s and dd["B"] <- s have such different behavior? See Introduction to R, sections 6.1 (Lists) and 6.3 (Data frames)

Re: [R] as.data.frame doesn't set col.names

2017-10-25 Thread Eric Berger
Hi Peter, Thanks for contributing such a great answer. Can you please provide a pointer to the documentation where it explains why dd$B <- s and dd["B"] <- s have such different behavior? (I am perfectly happy if you write the explanation but if it saves you time to point to some reference that wo

Re: [R] as.data.frame doesn't set col.names

2017-10-25 Thread Peter Dalgaard
> On 24 Oct 2017, at 22:45 , David L Carlson wrote: > > You left out all the most important bits of information. What is yo? Are you > trying to assign a data frame to a single column in another data frame? > Printing head(samples) tells us nothing about what data types you have, > especially

Re: [R] as.data.frame doesn't set col.names

2017-10-24 Thread David L Carlson
help-boun...@r-project.org] On Behalf Of Ed Siefker Sent: Tuesday, October 24, 2017 1:00 PM To: r-help Subject: Re: [R] as.data.frame doesn't set col.names Wait. Now I'm really confused. > > head(samples) quant_samples age sapply(yo, toupper) E11.5 F

Re: [R] as.data.frame doesn't set col.names

2017-10-24 Thread Ed Siefker
Wait. Now I'm really confused. > > head(samples) quant_samples age sapply(yo, toupper) E11.5 F20het BA40 E11.5 F20het BA40 E11.5 F20HET E11.5 F20het BA45 E11.5 F20het BA45 E11.5 F20HET E11.5 F20het BB84 E11.5 F20het BB84 E11.5

[R] as.data.frame doesn't set col.names

2017-10-24 Thread Ed Siefker
Why doesn't this work? > samples$geno <- as.data.frame(sapply(yo, toupper), col.names="geno") > samples quant_samples age sapply(yo, toupper) E11.5 F20het BA40 E11.5 F20het BA40 E11.5 F20HET E11.5 F20het BA45 E11.5 F20het BA45 E11.5 F20