Please, I am new here. I tried this project but I keep on getting the error below. Kindly assist

id <- c(1:10)

name <- c("John Mendes", "Rob Stewart", "Rachel Abrahamson", "Christy Hickman", "Johnson Harper", "Candace Miller", "Carlson Landy", "Pansy Jordan", "Darius Berry", "Claudia Garcia")

job_title <- c("Professional", "Programmer", "Management", "Clerical", "Developer", "Programmer", "Management", "Clerical", "Developer", "Programmer")
employee <- data.frame(id, name, job_title)
print(employee)
id name job_title
1 1 John Mendes Professional
2 2 Rob Stewart Programmer
3 3 Rachel Abrahamson Management
4 4 Christy Hickman Clerical
5 5 Johnson Harper Developer
6 6 Candace Miller Programmer
7 7 Carlson Landy Management
8 8 Pansy Jordan Clerical
9 9 Darius Berry Developer
10 10 Claudia Garcia Programmer
separate(employee, name,into=c("first_name", "last_name"), sep=' '

  • separate(employee, name,into=c("first_name", "last_name"), sep=" "
    Error: unexpected symbol in:
    "separate(employee, name,into=c("first_name", "last_name"), sep=' '
    separate"

separate(employee, name,into=c("first_name", "last_name"), sep=' '

  • separate(employee, name,into=c("first_name", "last_name"), sep=' ')
    Error: unexpected symbol in:
    "separate(employee, name,into=c("first_name", "last_name"), sep=' '
    separate"

separate(employee, name,into=c("first_name", "last_name"), sep=' ')
Error in separate(employee, name, into = c("first_name", "last_name"), :
could not find function "separate"
separate(employee, name,into=c("first_name", "last_name"), sep=" ")
Error in separate(employee, name, into = c("first_name", "last_name"), :
could not find function "separate"
print(employee)
id name job_title
1 1 John Mendes Professional
2 2 Rob Stewart Programmer
3 3 Rachel Abrahamson Management
4 4 Christy Hickman Clerical
5 5 Johnson Harper Developer
6 6 Candace Miller Programmer
7 7 Carlson Landy Management
8 8 Pansy Jordan Clerical
9 9 Darius Berry Developer
10 10 Claudia Garcia Programmer
separate(employee, name, into=c("first_name", "last_name"), sep=" ")
Error in separate(employee, name, into = c("first_name", "last_name"), :
could not find function "separate"
separate(employee,name,into=c('first_name','last_name'),sep=' ')
Error in separate(employee, name, into = c("first_name", "last_name"), :
could not find function "separate"
employee <- separate(employee,name,into=c('first_name','last_name'),sep=' ')
Error in separate(employee, name, into = c("first_name", "last_name"), :
could not find function "separate"
separate(employee,name,into=c('first_name','last_name'),sep=' ')
Error in separate(employee, name, into = c("first_name", "last_name"), :
could not find function "separate"
print(employee)
id name job_title
1 1 John Mendes Professional
2 2 Rob Stewart Programmer
3 3 Rachel Abrahamson Management
4 4 Christy Hickman Clerical
5 5 Johnson Harper Developer
6 6 Candace Miller Programmer
7 7 Carlson Landy Management
8 8 Pansy Jordan Clerical
9 9 Darius Berry Developer
10 10 Claudia Garcia Programmer
install.packages("separate")
Installing package into ‘/cloud/lib/x86_64-pc-linux-gnu-library/4.3’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘separate’ is not available for this version of R

A version of this package for your version of R might be available elsewhere,
see the ideas at

Warning in install.packages :
Perhaps you meant ‘sEparaTe’ ?

library(separate)
Error in library(separate) : there is no package called ‘separate’
print(employee)
id name job_title
1 1 John Mendes Professional
2 2 Rob Stewart Programmer
3 3 Rachel Abrahamson Management
4 4 Christy Hickman Clerical
5 5 Johnson Harper Developer
6 6 Candace Miller Programmer
7 7 Carlson Landy Management
8 8 Pansy Jordan Clerical
9 9 Darius Berry Developer
10 10 Claudia Garcia Programmer
Session restored from your saved work on 2023-Aug-19 20:41:58 UTC (16 hours ago)
installseparate(employee,name,into=c('first_name','last_name'), sep=' ')
Error in installseparate(employee, name, into = c("first_name", "last_name"), :
could not find function "installseparate"
separate(employee, name,into=c('first_name','last_name'), sep=' ')
Error in separate(employee, name, into = c("first_name", "last_name"), :
could not find function "separate"
library(tidyr)
Error in library(tidyr) : there is no package called ‘tidyr’
separate(employee, name, into=c('first_name','last_name'), sep=' ')
Error in separate(employee, name, into = c("first_name", "last_name"), :
could not find function "separate"
separate(employee, name, into = c('first_name','last_name'), sep =' ')
Error in separate(employee, name, into = c("first_name", "last_name"), :
could not find function "separate"
separate(employee, name, into = c("first_name", "last_name"), sep = " ")
Error in separate(employee, name, into = c("first_name", "last_name"), :
could not find function "separate"

Possibly you needed to say library(tidyr)

Not really. I am a challenge using separate(employee, name, into = c('first_name','last_name'), sep =' ')

separate(employee, name, into = c('first_name', 'last_name'), sep =' ')
Error in separate(employee, name, into = c("first_name", "last_name"), :
could not find function "separate"

separate(employee, name, into = c('first_name', 'last_name'), sep =' ')
Error in separate(employee, name, into = c("first_name", "last_name"), :
could not find function "separate"
[/quote]

Have you installed the package "tidyr" or "tidyverse"?

Yes.I have installed that

Usually the message "could not find..." indicates that you haven't issued the library command before using the function.

So how can I do that?

Restart R. Then put all your code into a script. Copy and paste the script here and separately show us what error you get. This way, someone here can try to replicate your work and try to reproduce the error.

Restart R, reload the dataset, then try:

library(tidyverse)
separate(employee, name,into=c("first_name", "last_name"), sep=' ')

separate() is a function from the tidyr package, part of the tidyverse, which is why you need to call library(tidyverse) for this to work. If you can't find a function in the future, you may be able to see what package it's from using ?? before the function name (??separate in this case). If you can't find the function there, you may be able to find information online by searching for something like "R separate function".

This topic was automatically closed 42 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.