car: Generate Random Vector of Cars

Description Usage Arguments Value See Also Examples

View source: R/car.R

Description

Generate a random vector of cars (see ?mtcars).

Usage

1
car(n, x = rownames(datasets::mtcars), prob = NULL, name = "Car")

Arguments

n

The number elements to generate. This can be globally set within the environment of r_data_frame or r_list.

x

A vector of elements to chose from.

prob

A vector of probabilities to chose from.

name

The name to assign to the output vector's varname attribute. This is used to auto assign names to the column/vector name when used inside of r_data_frame or r_list.

Value

Returns a random vector of car elements.

See Also

Other variable functions: age(), animal(), answer(), area(), children(), coin(), color, date_stamp(), death(), dice(), dna(), dob(), dummy(), education(), employment(), eye(), grade_level(), grade(), group(), hair(), height(), income(), internet_browser(), iq(), language, level(), likert(), lorem_ipsum(), marital(), military(), month(), name, normal(), political(), race(), religion(), sat(), sentence(), sex_inclusive(), sex(), smokes(), speed(), state(), string(), upper(), valid(), year(), zip_code()

Examples

1
2
car(10)
table(car(10000))

Example output

 [1] Camaro Z28         Toyota Corolla     Merc 230           Merc 450SL        
 [5] Ferrari Dino       Merc 240D          Fiat 128           Ford Pantera L    
 [9] Cadillac Fleetwood Fiat 128          
32 Levels: Mazda RX4 Mazda RX4 Wag Datsun 710 ... Volvo 142E

          Mazda RX4       Mazda RX4 Wag          Datsun 710      Hornet 4 Drive 
                307                 338                 303                 286 
  Hornet Sportabout             Valiant          Duster 360           Merc 240D 
                296                 312                 314                 344 
           Merc 230            Merc 280           Merc 280C          Merc 450SE 
                313                 292                 344                 289 
         Merc 450SL         Merc 450SLC  Cadillac Fleetwood Lincoln Continental 
                312                 320                 332                 324 
  Chrysler Imperial            Fiat 128         Honda Civic      Toyota Corolla 
                298                 311                 317                 308 
      Toyota Corona    Dodge Challenger         AMC Javelin          Camaro Z28 
                304                 301                 305                 314 
   Pontiac Firebird           Fiat X1-9       Porsche 914-2        Lotus Europa 
                294                 320                 325                 323 
     Ford Pantera L        Ferrari Dino       Maserati Bora          Volvo 142E 
                324                 366                 280                 284 

wakefield documentation built on Sept. 14, 2020, 1:07 a.m.