Error in Dataframe undefined columns selected

Hello everyone,
I'm trying to create a Taylor diagram using plotrix package in Rstudio.
I've let the program read my data file and then tried to create the diagram using taylor.diagram() code.
However, it gives the "Error in [.data.frame(pr, , 2) : undefined columns selected" error. Could you please help me solve this problem?
Below is my code.

setwd('C:/Users/Asus/Documents/ArcGIS/ArcGIS - Copy/evaporation/Downscaling Files')

getwd()

ls()

rm(list=ls())

install.packages(c("qmap", "zoo", "latticeExtra"))
install.packages(c("plotrix"))
library(plotrix)
library(qmap)
library(zoo)
library(latticeExtra)



temp <- read.csv(file="aydin_mgm_temp_mon.csv", header = FALSE)
pr <- read.csv(file="Aydin_hist_Pr45.csv", header = FALSE)

taylor.diagram(temp[,2],pr[,2])

Thanks in advance

I am not familiar with the taylor.diagram function but in this command

taylor.diagram(temp[,2],pr[,2])

you are trying to use the second column of both temp and pr. I can see in the image you posted that each of those data frames only has one column. Why are you trying to use the second column? Might this be what you want?

taylor.diagram(temp[,1],pr[,1])

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.