本文介绍了pkgsearch:as.POSIXct.default(date)中的错误:不知道如何将“ date”转换为类“ POSIXct”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

R包 pkgsearch 在使用 dplyr select 命令时会引发以下错误/ code>:

The R package pkgsearch throws the following error when using select command from dplyr:

请提供任何帮助。

library(tidyverse)
#> Registered S3 methods overwritten by 'ggplot2':
#>   method         from 
#>   [.quosures     rlang
#>   c.quosures     rlang
#>   print.quosures rlang
library(pkgsearch)

PkgMYaseen208 <-
    pkg_search(
          query  = "Yaseen"
        , format = c("short", "long")[1]
        , from   = 1
        , size   = 25
        ) %>% 
        arrange(package) 

PkgMYaseen208
#> - "Yaseen" -------------------------------- 20 packages in 0.009 seconds - 
#>   #     package          version by                 @ title               
#>   1  65 agriTutorial     0.1.4   Rodney Edmondson  9M Tutorial Analysis...
#>   2  88 bayesammi        0.1.0   Muhammad Yaseen   1y Bayesian Estimati...
#>   3 100 baystability     0.1.0   Muhammad Yaseen   1y Bayesian Stabilit...
#>   4  91 DiallelAnalysisR 0.1.1   Muhammad Yaseen   3y Diallel Analysis ...
#>   5  88 dmai             0.4.0   Muhammad Yaseen   6d Divisia Monetary ...
#>   6  91 eda4treeR        0.2.0   Muhammad Yaseen   1y Experimental Desi...
#>   7  97 gvcR             0.1.0   Muhammad Yaseen   1y Genotypic Varianc...
#>   8  91 PakPC2017        1.0.0   Muhammad Yaseen   1y Pakistan Populati...
#>   9  91 PakPMICS2014Ch   0.1.0   Muhammad Yaseen   2y Multiple Indicato...
#>  10  94 PakPMICS2014HH   0.1.0   Muhammad Yaseen   2y Multiple Indicato...
#>  11  98 PakPMICS2014HL   0.1.0   Muhammad Yaseen   2y Multiple Indicato...
#>  12  94 PakPMICS2014Wm   0.1.0   Muhammad Yaseen   2y Multiple Indicato...
#>  13  91 ppcSpatial       0.2.0   Muhammad Yaseen   1y Spatial Analysis ...
#>  14  94 PSLM2015         0.2.0   Muhammad Yaseen   1y Pakistan Social a...
#>  15  86 qccrs            0.1.0   Muhammad Yaseen   6M Quality Control C...
#>  16  87 rgsp             0.2.0   Muhammad Yaseen   7M Repetitive Group ...
#>  17  98 stability        0.5.0   Muhammad Yaseen   8M Stability Analysi...
#>  18  96 StroupGLMM       0.1.0   Muhammad Yaseen   3y R Codes and Datas...
#>  19  88 SupMZ            0.1.0   Muhammad Yaseen  13h Detecting Structu...
#>  20  87 VetResearchLMM   1.0.0   Muhammad Yaseen   1y Linear Mixed Mode...

PkgMYaseen208 %>%
        dplyr::select(package)
#> - "Yaseen" -------------------------------- 20 packages in 0.009 seconds -
#> Warning: Unknown or uninitialised column: 'score'.
#> Warning: Unknown or uninitialised column: 'version'.
#> Warning: Unknown or uninitialised column: 'maintainer_name'.
#> Warning: Unknown or uninitialised column: 'date'.
#> Error in as.POSIXct.default(date): do not know how to convert 'date' to class "POSIXct"


推荐答案

这可能是数据集( str(PkgMYaseen208))属性的问题。一种选择是转换为 data.frame ,然后 select

It could be an issue with the attributes of the dataset (str(PkgMYaseen208)). One option is to convert to data.frame and then select

library(dplyr)
PkgMYaseen208 %>% 
  as.data.frame %>% 
  dplyr::select(package)
#          package
#1      agriTutorial
#2         bayesammi
#3      baystability
#4  DiallelAnalysisR
#5              dmai
#6         eda4treeR
#7              gvcR
#8         PakPC2017
#9    PakPMICS2014Ch
#10   PakPMICS2014HH
#1   PakPMICS2014HL
#2   PakPMICS2014Wm
#3       ppcSpatial
#4         PSLM2015
#15            qccrs
#16             rgsp
#17        stability
#18       StroupGLMM
#19            SupMZ
#20   VetResearchLMM

这篇关于pkgsearch:as.POSIXct.default(date)中的错误:不知道如何将“ date”转换为类“ POSIXct”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-10 10:44