Getting an error trying to check how many datasets in my data

Hi all,
I am trying to check how many data sets in my data.

I searched on line and saw the data() command but when I run it it gives ne this error

data(d4)
Warning message:
In data(d4) : data set ‘d4’ not found

PS: very new to R and coding

Can you elaborate on what you mean by "how many data sets in my data? Ideally, could you provide a proper REPRoducible EXample (reprex) illustrating your issue.

I am trying to find out how many data set in my subset data,d4.
I did a Print and dim already but not sure if it is giving me the correct answer.
I am now trying to use the command data(d4) but I get this error

data(d4)
Warning message:
In data(d4) : data set ‘d4’ not found

Sorry but this sentence makes no sense to me, Do you mean how many variables or columns are in your dataset?

The data() function is for loading data frames from packages, it is not going to give you any information about your data.

I'm confused as well as to what I am need to do cos this was a question from homework.
I am guessing I will just use the 'dim' command.

Thanks

If you run the data() command with a name in quotes, you will cause that particular data set to be loaded. For example

data("faithful")

If you run the data() function with no arguments, like this

data()

you will get a list of all data sets in the loaded packages. I think that is what you are after.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.