Hello all
I'm very new to this and would appreciate some help here. I am trying to analyse a table from a .csv document, and would like to create a visualisation for the most frequently occurring variable in a column, e.g. the column shows start time, end time, trip duration, gender of user, date of birth, etc.
I'm having some difficulty in figuring out how to create a visualisation to show the mode (most frequently occurring observation) for each column and compare the results.
I am currently just trying to compare 2 things to each other but I cannot seem to be able to form a graph.
I have installed and loaded both tidyverse and ggplot2, and I'm writing the code in the Source pane (not the console), but I need assistance in figuring out what to write exactly. The .csv file has also been imported.
One of the columns has a date/time data type (unsure if this is a contributing factor) and the other just has numbers. These are just two variables of many that I would like to compare.
I'd appreciate any help with this.
I tried the following, expecting a scatterplot:
data=read.csv('dataset1.csv')
print(data)
plot(x = data$x,y = data$y,
xlab = "x-axis",
ylab = "y-axis",
main = "Plot")
I got the following message with no output:
Error in plot.window(...) : need finite 'xlim' values
In addition: Warning messages:
1: In min(x) : no non-missing arguments to min; returning Inf
2: In max(x) : no non-missing arguments to max; returning -Inf
3: In min(x) : no non-missing arguments to min; returning Inf
4: In max(x) : no non-missing arguments to max; returning -Inf
and this:
ggplot(data = bikeshare) +
- geom_point(mapping = aes(x=start_time, y=tripduration))
Error infortify()
:
!data
must be a <data.frame>, or an object coercible byfortify()
, not
the string "Divvy_Trips_2019_Q4.csv".
Runrlang::last_trace()
to see where the error occurred.
ggplot(df, aes(x=start_time, y=tripduration)) +
- geom_point()
Error inggplot()
:
!data
cannot be a function.
Have you misspelled the
data
argument inggplot()
Runrlang::last_trace()
to see where the error occurred.
rlang::last_trace()
<error/rlang_error>
Error inggplot()
:
!data
cannot be a function.
Have you misspelled the
data
argument inggplot()
#create scatter plot
ggplot(df, aes(x=start_time, y=tripduration))
Error inggplot()
:
!data
cannot be a function.
Have you misspelled the
data
argument inggplot()
Runrlang::last_trace()
to see where the error occurred.
#create scatter plot
ggplot(data, aes(x=start_time, y=tripduration))
Error inggplot()
:
!data
cannot be a function.
Have you misspelled the
data
argument inggplot()
Runrlang::last_trace()
to see where the error occurred.
- List item