Error: object not found after being defined in R - r

I have just started using R, and I seem to be falling over at the first hurdle...
I have defined an object in my R project which is the csv data for a file I have stored on my PC:
rgvaAssessment<-read.csv("C:\\Users\\cheddar\\Downloads\\attachments\\rgva_assessment X.csv")
However, when I type the object name in the R console, I get the following error:
> rgvaAssessment
Error: object 'rgvaAssessment' not found
Could someone please let me know what obvious error I am making here? The file definitely exists in the defined location.
Thanks

Related

Error message in Ferret related to a netcdf file

I am actually trying to open a netcdf file with 'Ferret' and I get this error message.
In sum up, when trying to open the file:
use all_sondes_test.nc
I get the following message:
NetCDF: Not a valid data type or _FillValue type mismatch (OPeNDAP/netCDF Error code -45) is this a CDF file ?
I hope the problem looks clear to the community.
I have already tried to find some help on the web, without any success.
Thanks for your help !

jsonlite::fromJSON is not working properly

I am trying to read in a JSON file (that I unfortunately cannot post here) into R using the fromJSON function from the jsonlite package.
Thereby, I always get a parsing error and I don't know why. The really strange thing is that I have two versions of the same file that appear absolutely the same to me in e.g. jsonformatter.org .
Does anyone know this error or how to track it? Is there another good way to read in JSON files into R?
Here is the error message:
Error in parse_con(txt, bigint_as_char) :
lexical error: invalid char in json text.
ÿþ{ (right here) ------^

R, How do I use here() within parse()

I know how much you love the here() package... I'm just starting to catching on.
I am trying to write an (relatively) automated code for cleaning data and I would like to use here() and parse(). But parse() doesn't seem to like having here() within it.
cleaning <- parse(file = here("folder", "source-code.R"))
and I get the error:
Error in here("folder", "source-code.R"):
unused argument ("source-code.R")
If I set my working directory as the folder containing "source-code.R" and remove the here() argument, the process works just fine.
also, I've tried removing the "folder" and just calling the "source-code.R", but then I get the error:
Error in parse(file = here("source-code.R")) :
'file' must be a character string or connection
thanks for your help!
Thanks to MrFlick who recognized the naming conflict. Using here::here() solved it!

How to solve this error message in rmarkdown?

I am just starting to explore the rmarkdown package. I don't use Rstudio. I use the default R environment. What I did was as follows.
I created a new R document.
Started typing few lines in rmarkdown format.
Saved the file with Rmd extension.
I saved the file in the working directory.
I installed the pandoc using the pkg file.
I installed 'rmarkdown' package. Loaded the package.
Used the following command to render the Rmd file.
rmarkdown::render("Untitled.Rmd")
I get the following error.
Error in tools::file_path_as_absolute(input) : file 'Untitled.Rmd'
does not exist
I tried all the possible ways such as giving the exact path instead of filename etc. But nothing worked out. I googled the error message and found that none had similar error. Can someone help me with this. What I am missing. What the error message mean?
Most of the time the error file not found is either a type error or a real missing file (as in your case, the real one is named in another way).
In order to discard those possibilities:
Copy the fullpath from your filebrowser.
Make sure the file exists, inside R you could type:
file.exists("/fullpath/to/file")
If that return TRUE and the error persists, then you suspect another thing is going on.

Slow or stacking file.choose() in R

If I have more data loaded in R I'm having difficulties with opening and choosing new file via file.choose() and later upload via read.csv(), but I would not get to that point since the file.choose function stacks and the R "crushes" and reports something like "unidentified error occurred and that the R must restart".
I'm using RStudio and running this on Windows 7. The hardware is up to date.
Could someone point me on why this is happing and what would be a remedy against this. Are there other options to select file? I know I can insert the path right into the read.csv command, but the (file is different every time).
EDIT:
The error just happened again. I can not reproduce the error so it happens rather only with high likelihood if the conditions for it are met.
The error reads as: R Session Aborted.R encountered fatal error. The session was terminated. And in window: "Start New Session".
EDIT 2:
I would just rephrase my question. The question is whether there is other option like command or package that deals with choosing a file. [file.choose()]
The error can not be reproduced and hence I can not expect someone gives reasonable comment on this. But if this occurred someone in the past and solved it, I would like to hear about it. Thanks.
EDIT 3: Further to the error. I have spotted just now sentence in red in Console: Error: Unable to provide connection with R

Resources