+ Reply to Thread
Results 1 to 9 of 9

Thread: How to search dataset

  1. #1
    Points: 3,216, Level: 35
    Level completed: 11%, Points required for next Level: 134

    Posts
    65
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to search dataset



    Hi folks,

    I can't figure out using help.search to find the name of the dataset on database. If it is NOT the right tool please advise which tool shall I use? TIA

    B.R.
    Stephen L

  2. #2
    RotParaTon
    Points: 46,233, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Awards:
    Discussion EnderPosting AwardFrequent PosterCommunity AwardMaster Tagger
    Dason's Avatar
    Location
    Ames, IA
    Posts
    9,077
    Thanks
    211
    Thanked 1,607 Times in 1,377 Posts

    Re: How to search dataset

    what do you mean "on database"? Do you mean a dataset that is loaded into R by default? Or do you really mean on a database that you would need to access through some sort of database language?

  3. #3
    Points: 3,216, Level: 35
    Level completed: 11%, Points required for next Level: 134

    Posts
    65
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How to search dataset

    Quote Originally Posted by Dason View Post
    what do you mean "on database"? Do you mean a dataset that is loaded into R by default? Or do you really mean on a database that you would need to access through some sort of database language?
    Hi,

    I referred to the datasets on;

    1)
    data()

    2)
    library(AER) # as example
    data()

    Thanks

    B.R.
    satimis

  4. #4
    RotParaTon
    Points: 46,233, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Awards:
    Discussion EnderPosting AwardFrequent PosterCommunity AwardMaster Tagger
    Dason's Avatar
    Location
    Ames, IA
    Posts
    9,077
    Thanks
    211
    Thanked 1,607 Times in 1,377 Posts

    Re: How to search dataset

    data() will give you a list of all the datasets currently loaded.

    Once you load a package the datasets that come with that package will be shown with data() as well.

    If you just want to know what datasets come with a package before loading (or even after loading it) you can use data(package = "package_name_here").

    If you want to list all the available datasets for all packages (even if they aren't loaded yet) you can use data(package = .packages(all.available = TRUE))

  5. #5
    Points: 3,216, Level: 35
    Level completed: 11%, Points required for next Level: 134

    Posts
    65
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How to search dataset

    Quote Originally Posted by Dason View Post
    data() will give you a list of all the datasets currently loaded.

    Once you load a package the datasets that come with that package will be shown with data() as well.

    If you just want to know what datasets come with a package before loading (or even after loading it) you can use data(package = "package_name_here").

    If you want to list all the available datasets for all packages (even if they aren't loaded yet) you can use data(package = .packages(all.available = TRUE))
    > data(package = "DNase")
    Code: 
    Error in .find.package(package, lib.loc, verbose = verbose) : 
      there is no package called 'DNase'
    > data() # DNase is there.

    > data(package = "BOD")
    Code: 
    Error in .find.package(package, lib.loc, verbose = verbose) : 
      there is no package called 'BOD'
    > data() # BOD is there.


    > data(package = .packages(all.available = TRUE))
    Code: 
    Warning messages:
    1: In data(package = .packages(all.available = TRUE)) :
      datasets have been moved from package 'base' to package 'datasets'
    2: In data(package = .packages(all.available = TRUE)) :
      datasets have been moved from package 'stats' to package 'datasets'
    It works. Thanks

    B.R.
    satimis

  6. #6
    Points: 3,216, Level: 35
    Level completed: 11%, Points required for next Level: 134

    Posts
    65
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How to search dataset

    Hi folks,

    I still haven't resolved to find from which package a dataset comes.

    e.g.
    If I want to find which package provides "MedUnits" what command shall I run?

    TIA

    B.R.
    satimis

  7. #7
    RotParaTon
    Points: 46,233, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Awards:
    Discussion EnderPosting AwardFrequent PosterCommunity AwardMaster Tagger
    Dason's Avatar
    Location
    Ames, IA
    Posts
    9,077
    Thanks
    211
    Thanked 1,607 Times in 1,377 Posts

    Re: How to search dataset

    Try
    Code: 
    ?MedUnits
    At the top of the help page it will tell you which package it comes from.

  8. #8
    Points: 3,216, Level: 35
    Level completed: 11%, Points required for next Level: 134

    Posts
    65
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How to search dataset

    Quote Originally Posted by Dason View Post
    Try
    Code: 
    ?MedUnits
    At the top of the help page it will tell you which package it comes from.
    Thanks

    Some of them need ??

    e.g.
    ?MedUnits

    doesn't work

    ??MedUnits
    works

    B.R.
    satimis

  9. #9
    RotParaTon
    Points: 46,233, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Awards:
    Discussion EnderPosting AwardFrequent PosterCommunity AwardMaster Tagger
    Dason's Avatar
    Location
    Ames, IA
    Posts
    9,077
    Thanks
    211
    Thanked 1,607 Times in 1,377 Posts

    Re: How to search dataset


    Ah. If you don't have the dataset loaded yet then I think you would need the double question marks.

+ Reply to Thread

Similar Threads

  1. What GLM should is use in this dataset?
    By juantamad in forum Regression Analysis
    Replies: 1
    Last Post: 03-05-2011, 03:22 AM
  2. AMOS Spec Search
    By dcoleman4 in forum SPSS
    Replies: 0
    Last Post: 11-10-2010, 12:57 PM
  3. fixing a dataset
    By WeeG in forum SAS
    Replies: 3
    Last Post: 02-11-2010, 05:43 AM
  4. Problems with search feature?
    By trmstat in forum Statistics
    Replies: 2
    Last Post: 08-01-2008, 08:58 AM
  5. impact of factors of search engine rankings
    By Analytics in forum Statistics
    Replies: 5
    Last Post: 08-29-2007, 05:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts








Advertise on Talk Stats