Am I importing data wrong?

Hi all,

I'm very new to R and having difficulty. I imported a data set yesterday in my lab and was able to work on it but since then whenever I import data I am getting subset errors.

df[2,3]
Error in df[2, 3] : object of type 'closure' is not subsettable

df[2]
Error in df[2] : object of type 'closure' is not subsettable

I think this has something to do with the way I am importing my data but because the initial data I imported during lab worked well.

My current method of importing importing from Text (readr) and copying and pasting the first two lines from my code preview into my R script.

Your help will be much appreciated!

For import data use this step, is very easy.
I assume the file is in documents. Put in the console

file.choose()

Appear a new window, in this you need find the file, and press open. Instant appear the file directory in the console.

image

This in my computer.

Now, Im copy the path and run.

library(readxl)
N<-read_excel("C:\\Users\\MiguelAngel\\Documents\\R Miguelo\\Norberto Mex\\Modelo Regresion Multiple.xlsx")

Thank you! I was still having issues but once I restarted R it seemed to work

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.