Re: [R] understanding the no-label concept

2014-10-20 Thread Ista Zahn
On Thu, Oct 16, 2014 at 3:19 PM, wrote: >> aa <- 1:5 >> names(aa) <- c("Eins", "Zwei", "Drei", "Vier", "Fünf") >> aa > Eins Zwei Drei Vier Fünf >12345 >> table(aa) > 1 2 3 4 5 > 1 1 1 1 1 > > You see? It didn't work. perhaps you want table(names(aa)) Or maybe just aa <- -

Re: [R] understanding the no-label concept

2014-10-16 Thread moonkid
> aa <- 1:5 > names(aa) <- c("Eins", "Zwei", "Drei", "Vier", "Fünf") > aa Eins Zwei Drei Vier Fünf 12345 > table(aa) 1 2 3 4 5 1 1 1 1 1 You see? It didn't work. > aa <- c(aa, 1, 2) > aa Eins Zwei Drei Vier Fünf 1234512 This is no solution for my cas

Re: [R] understanding the no-label concept

2014-10-16 Thread moonkid
On 2014-10-11 15:14 William Dunlap wrote: > You can use 'factors' to assign labels to small integer values. E.g., >> x <- c(1,2,3,4,3) >> fx <- factor(x, levels=1:5, >> labels=c("One","Two","Three","Four","Five")) table(fx) >fx > One Two Three Four Five >1 1

Re: [R] understanding the no-label concept

2014-10-16 Thread moonkid
On 2014-10-11 14:16 David Winsemius wrote: > Hmisc... Tried but has no effect on table() calls. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.ht

Re: [R] understanding the no-label concept

2014-10-11 Thread Prof Brian Ripley
On 11/10/2014 22:16, David Winsemius wrote: On Oct 11, 2014, at 1:04 PM, Richard M. Heiberger wrote: It looks like a terminology issue. R has names for elements of a vector and for rows and columns of a matrix or data.frame, and more generally for all dimensions of multi-dimensional array. I

Re: [R] understanding the no-label concept

2014-10-11 Thread William Dunlap
You can use 'factors' to assign labels to small integer values. E.g., > x <- c(1,2,3,4,3) > fx <- factor(x, levels=1:5, labels=c("One","Two","Three","Four","Five")) > table(fx) fx One Two Three Four Five 1 1 2 1 0 Bill Dunlap TIBCO Software wdunlap tibc

Re: [R] understanding the no-label concept

2014-10-11 Thread David Winsemius
On Oct 11, 2014, at 1:04 PM, Richard M. Heiberger wrote: > It looks like a terminology issue. R has names for elements of a > vector and for rows and > columns of a matrix or data.frame, and more generally for all > dimensions of multi-dimensional array. > > I think your next step is to read th

Re: [R] understanding the no-label concept

2014-10-11 Thread Bert Gunter
No, you are wrong. Read the docs! -- start with "An Introduction to R" which ships with R. Please do not post further until after you have done your homework. x <- c(a=1,b=2,c=3) See also ?names. Cheers, Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 "Data is not informat

Re: [R] understanding the no-label concept

2014-10-11 Thread Richard M. Heiberger
It looks like a terminology issue. R has names for elements of a vector and for rows and columns of a matrix or data.frame, and more generally for all dimensions of multi-dimensional array. I think your next step is to read the introductory document. Start with either of these (they are the same

[R] understanding the no-label concept

2014-10-11 Thread moonkid
I am new to R but a bit familiar with Stata and SPSS and a software dev. As I understand it right, there is no possibility to give variables or values a lable. Is that right? Just for example. "x" need a name. And the four values (1, 2, 3, 4) need it to. [code] > table(x) 1 2 3 4 17 6 6 2