Skip to content

c weirdness

4 messages · Sam Steingold, Duncan Murdoch, William Dunlap

#
is there a way to avoid c() appending ".0" and ".1" to seed?
--8<---------------cut here---------------start------------->8---
nons seed                       ## good!
   1    3
nons  seed.0                 ## don't want ".0"!
      1 2344600
nons seed.1                   ## don't want ".1"!
     1   6843
0       1 
2344600    6843 
--8<---------------cut here---------------end--------------->8---
#
On 07/11/2012 3:53 PM, Sam Steingold wrote:
Don't give it a named vector.  You can use the unname() function to 
strip the names from tab:

c("nons"=1, "seed"=unname(tab[1]))
#
Your example doesn't work here - you didn't show what 'tab' was.
Perhaps it was an output of table:
n seed.17
      1       3
n seed
   1    3

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com
#
Or use [[ instead of [ (assuming you are only selecting one item)
n seed.17
      1       3
n seed
   1    3
n seed
   1    3
n seed
   1    3

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com