Adi Lavy Posted September 2, 2020 Share Posted September 2, 2020 I am trying to use the function pivot_longer from the dplyr package but I get an error saying that pivot_longer is not available. Running on Spotfire 10.10 and TERR 5.1.0, 64 bit on Windows 10 within Parallels virtual machine. I am using this command which works fine on RStudio with TERR engine: df %>% mutate_if(is.numeric,as.character, is.factor, as.character) %>% pivot_longer( cols = everything(), names_to = c('Resource type', 'Input-Output', 'Resource', 'Property', '.value'), values_to = "val", values_ptypes = list(val = 'character'), names_pattern = '(\w.+) \| (\w.+) \| (\w.+) \| (\w.+) \| (\w.+)')and this is the error: TIBCO Enterprise Runtime for R returned an error The data function 'Bill of Materials expanded (11) (Bill of Materials expanded)' could not be executed. Error in function_list[[k]](value) : could not find function "pivot_longer" eval(script, envir = .GlobalEnv eval(script, envir = .GlobalEnv) withCallingHandlers({ df %>% mutate_if(is.numeric, as.character, is.factor, as.character) %>% pivot_longer(cols = everything(), withVisible(eval(quote(`_fseq`(`_lhs`)), env, env)) val(quote(`_fseq`(`_lhs`)), env, env) eval(quote(`_fseq`(`_lhs`)), env, env) `_fseq`(`_lhs`) freduce(value, `_function_list`) withVisible(function_list[[k]](value)) function_list[[k]](value) Link to comment Share on other sites More sharing options...
Fabian Duerr Posted September 3, 2020 Share Posted September 3, 2020 I have the same issue and I think it is because the latest dplyr package is not installed on our R server. But maybe there is another reason... Instead of using pivot_longer and pivot_wider use gahter and spread from older dplyr versions. They work well. Link to comment Share on other sites More sharing options...
Chris Kuty Posted September 22, 2020 Share Posted September 22, 2020 Both pivot_longer and pivot_wider actually reside in the tidyr package. But my brain keeps wanting it to be in dplyr as well. :) 8.3.4 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now