代码之家  ›  专栏  ›  技术社区  ›  LuckyProgrammer

使用as绘制splom()图形。数据框架

  •  1
  • LuckyProgrammer  · 技术社区  · 8 年前

    我需要建立一个 splom() 图形使用 lattice 包含的包 as.data.frame 功能,但不起作用。

    library(lattice)
    data(Investment, package = "sandwich")
    Investment <- as.data.frame(Investment, GNP)
    splom(Investment|"Graphic", xlab = "Investment", ylab = "GNP")
    
    1 回复  |  直到 8 年前
        1
  •  2
  •   Samuel    8 年前

    你可以试试这个:

    library(lattice)
    data(Investment, package = "sandwich")
    Investment <- as.data.frame(Investment)
    
    splom(
      x = Investment[c("Investment", "GNP")], 
      main = "Graphic"
    )