Friday 15 February 2013

r - Why does the table function find a variable that was deleted -


Why does the table function get a variable that was deleted?

  dog & lt; - C ("Rover", "Spot") Cat & lt; - c ("Scratch", "Flomi") Pets & lt; - Data. Frame (dog, cat) # Creating a data frame with two variable names (pets) # 1] "dog" "cat" # Name of long-term name of the dog (pet) [name (pet Animal) == "dog"] and "- dog_as_very_long_name" pet $ dog & lt; - NULL # Remove dog names (pets) # [1] "Dog_as_very_long_name" "Cat" # Variable dog data sets no longer contain table (pet $ dog) # Table variable on a variable that has # rover spots # 1 1  was removed  $  in some uses that are due to partial matching / pre>  

.

Try this:

  & gt; By using the table (Pet $ Ca) Fluffy Scratch 1 1   

[[ notation will give you more control.

  & gt; Table (pet [["Ca"]]) & lt; Border 0's table & gt; & Gt; You can use the  options  settings to warn you the table (pet [["ca", exact = false]]) alcoholic scratch 1 1   

Consider when partial matches are used:

  & gt; Option (warning_content_modulator = TRUE) & gt; Table (Pets $ Ca) Fluffy Scratch 1 1 Warning Message: Pet Ca $ $ Ca: 'Ca' Partial Match 'Cat' & gt; Table (pet $ dog) Rover spot 1 1 Warning message: Pet dog $ dog: 'dog' '' Antarctic match 'to' dog_s_ful_long_name '   

No comments:

Post a Comment