I am trying to bring two datasets together.
blinks_full <-
setuplong %>%
mutate(
sub = as.numeric(gsub("subject_","",sub)),
trial_number = as.numeric(gsub("trial_","",trial_number))
) %>%
rename(trial_no = trial_number) %>%
full_join(x = ., y = eyedata)
I keep getting this:
Error: by
must be supplied when x
and y
have no common variables.
i use by = character()` to perform a cross-join.
I'm not sure how to fix this.
Error: by
must be supplied when x
and y
have no common variables.
That is the issue.
Can you provide a reproducible example?
A minimal reproducible example consists of the following items:
A minimal dataset, necessary to reproduce the issue
The minimal runnable code necessary to reproduce the issue, which can be run
on the given dataset, and including the necessary information on the used packages.
Let's quickly go over each one of these with examples:
Minimal Dataset (Sample Data)
You need to provide a data frame that is small enough to be (reasonably) pasted on a post, but big enough to reproduce your issue.
Let's say, as an example, that you are working with the iris data frame
head(iris)
#> Sepal.Length Sepal.Width Petal.Length Petal.Width Species
#> 1 5.1 3.5 1.4 0.…
MyKo101
December 31, 2020, 12:25am
3
full_join()
will look at the names of the variables in x
and y
to see where they overlap. It will then, by default, try to merge based on the overlapping variables.
data_1 <- tibble(x=1:3,y=2:4,z=3:5)
data_2 <- tibble(x=1:4,w=5:8)
full_join(data_1,data_2)
The above will try to join on x
since that is the only variable that bot datasets have in common. Have a look at what variables are in eyedata
. Based on this error, I'd say that none of them match the dataset being piped into full_join()
(i.e. the one passed through mutate()
and rename()
).
system
Closed
January 21, 2021, 12:25am
4
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed. If you have a query related to it or one of the replies, start a new topic and refer back with a link.