Sorry to ask such a simple question, but I can't find the answer after
extensive searching the docs and the web.
How do you remove a component from a list? For example say you have:
lst-c(5,6,7,8,9)
How do you remove, for example, the third component in the list?
lst[[3]]]-NULL generates
The first example you provide is a vector, not a list. You can
remove the third element with:
lst[-3]
[1] 5 6 8 9
The same thing works for rows of data frames:
frame[-3,]
lst1 lst2
116
227
449
55 10
On 08/02/07, Jason Horn [EMAIL PROTECTED]
Hi Jason,
On 2/8/07, Jason Horn [EMAIL PROTECTED] wrote:
Sorry to ask such a simple question, but I can't find the answer after
extensive searching the docs and the web.
How do you remove a component from a list? For example say you have:
You use the - operator for both your vector and
First:
lst - lst[-3]
Second:
frame- frame[-2,]
On 08/02/07, Jason Horn [EMAIL PROTECTED] wrote:
Sorry to ask such a simple question, but I can't find the answer after
extensive searching the docs and the web.
How do you remove a component from a list? For example say you have:
On 2/8/2007 12:30 PM, Jason Horn wrote:
Sorry to ask such a simple question, but I can't find the answer after
extensive searching the docs and the web.
How do you remove a component from a list? For example say you have:
lst-c(5,6,7,8,9)
In R jargon, that's a vector, not a list.
How
Jason Horn wrote:
Sorry to ask such a simple question, but I can't find the answer after
extensive searching the docs and the web.
How do you remove a component from a list? For example say you have:
lst-c(5,6,7,8,9)
How do you remove, for example, the third component in the list?
On 2/8/2007 1:09 PM, Duncan Murdoch wrote:
On 2/8/2007 12:30 PM, Jason Horn wrote:
Sorry to ask such a simple question, but I can't find the answer after
extensive searching the docs and the web.
How do you remove a component from a list? For example say you have:
lst-c(5,6,7,8,9)
In