Loading .rld files extension in R

Hello, I receive files with the .rld extension from a data logger, with wind information.

Data are collected from readings of meteorological sensors and other devices and then stored in the loggers for either manual retrieval or automated delivery to the location of your choice. In my case it's send by email.

Then the file can be open with different software from the data logger maker or with a software call windographer. It can't be open with the notepad but it can be converted to a txt file with windographer or with the other software from the data logger maker.

I would like to upload this file to R to work with the data it brings but I have not found information about it. Maybe someone can help me with information?

Regards.

La extensión .rld no parece ser de uso exclusivo, puedes dar más detalles acerca del equipo que produce estos archivos? Si intentas abrir este archivo cómo un archivo de texto (Block de notas en Windows) obtienes texto legible?

Nota: Por favor intenta hacer tus preguntas en inglés, ya que es el idioma preferido aquí y al usar español estás excluyendo a la mayoría de la conversación, reduciendo así tus posibilidades de obtener ayuda.

Gracias, voy a replantear la pregunta en inglés.

What is the brand of the data logger? I don't think there is a mainstream package for this but maybe with enough information you could find something on Github.

If you are OK with making this intermediate step you can read txt files into R and then parse the content, although, we would need a sample of the txt file to help you with this approach.

The data logger brand is NRG.

I would like to skip the converting step but If it is not possible then I´ll have to do it.

I can't find an R package for this but there is a python package, you could convert the files into txt using this package and then keep working with R, and you can even do it from within R using the reticulate package.

Edit: Apparently the python library is just a wrapper for the NRG-software's API, so, in theory, you could use the API directly from R as well.

Thank you for the support.

I installed the reticulate package but I am not familiar with python. I was following some help in github to install python packages.

I installed the ngrpy package but I don't get to import it. I used this commands:

library(reticulate)

# VIRTUAL
# create a new environment 
virtualenv_create("r-reticulate")

# install nrgpy
virtualenv_install("r-reticulate", "nrgpy")

# import nrgpy (it will be automatically discovered in "r-reticulate")
nrgpy <- import("nrgpy")

When I run the line virtualenv_install("r-reticulate", "nrgpy") it says that the nrgpy package has been installed.

When I get to the last line to import("ngrpy") I get this error in the console:

Error in py_module_import(module, convert = convert) : 
  ModuleNotFoundError: No module named 'nrgpy'

After all of this I'm suppossed to source the python script but I can't without the nrgpy package.

Please any help.

I run today the same code again and I got a new message. These are the results from the console

> library(reticulate)
> 
> # VIRTUAL
> # create a new environment 
> virtualenv_create("r-reticulate")
virtualenv: r-reticulate
> 
> # install nrgpy
> virtualenv_install("r-reticulate", "nrgpy")
Using virtual environment "r-reticulate" ...
Requirement already up-to-date: nrgpy in g:\documents\.virtualenvs\r-reticulate\lib\site-packages (0.14.2)
Requirement already satisfied, skipping upgrade: requests in g:\documents\.virtualenvs\r-reticulate\lib\site-packages (from nrgpy) (2.24.0)
Requirement already satisfied, skipping upgrade: pandas>=0.23 in g:\documents\.virtualenvs\r-reticulate\lib\site-packages (from nrgpy) (1.1.2)
Requirement already satisfied, skipping upgrade: idna<3,>=2.5 in g:\documents\.virtualenvs\r-reticulate\lib\site-packages (from requests->nrgpy) (2.10)
Requirement already satisfied, skipping upgrade: chardet<4,>=3.0.2 in g:\documents\.virtualenvs\r-reticulate\lib\site-packages (from requests->nrgpy) (3.0.4)
Requirement already satisfied, skipping upgrade: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in g:\documents\.virtualenvs\r-reticulate\lib\site-packages (from requests->nrgpy) (1.25.10)
Requirement already satisfied, skipping upgrade: certifi>=2017.4.17 in c:\users\punku\appdata\local\r-miniconda\envs\r-reticulate\lib\site-packages (from requests->nrgpy) (2020.6.20)
Requirement already satisfied, skipping upgrade: numpy>=1.15.4 in g:\documents\.virtualenvs\r-reticulate\lib\site-packages (from pandas>=0.23->nrgpy) (1.19.1)
Requirement already satisfied, skipping upgrade: python-dateutil>=2.7.3 in g:\documents\.virtualenvs\r-reticulate\lib\site-packages (from pandas>=0.23->nrgpy) (2.8.1)
Requirement already satisfied, skipping upgrade: pytz>=2017.2 in g:\documents\.virtualenvs\r-reticulate\lib\site-packages (from pandas>=0.23->nrgpy) (2020.1)
Requirement already satisfied, skipping upgrade: six>=1.5 in g:\documents\.virtualenvs\r-reticulate\lib\site-packages (from python-dateutil>=2.7.3->pandas>=0.23->nrgpy) (1.15.0)
> 
> # import nrgpy (it will be automatically discovered in "r-reticulate")
> nrgpy <- import("nrgpy", convert = TRUE)
"Error in if (is.null(config$numpy) || config$numpy$version < "1.6") numpy_load_error <- "installation of Numpy >= 1.6 not found" else numpy_load_error <- "" : 
  missing value where TRUE/FALSE needed"

I don't know what to do. Please advice.

Managing python packages from R is a nightmare for me (for some reason reticulate doesn't like python 3.6), I usually give up and simply install all I need from the terminal, in this case:

sudo pip3 install nrgpy # I'm using python 3.6 so I use pip3 instead of pip

And then in R

library(reticulate)
use_virtualenv("r-reticulate")
nrgpy <- import("nrgpy")

This loads the module without any error messages, but I can't test the function since I don't have a license for the NRG software (thus no access to the API).

Edit: In your case it seems you need to update numpy

I did what you told me. I used the terminal to install nrgpy and then in R I run the commands but I still get an error as shown below.

> library(reticulate)
> # indicate that we want to use a specific virtualenv
> use_virtualenv("r-reticulate")
> # import nrgpy (it will be automatically discovered in "r-reticulate")
> nrgpy <- import("nrgpy")
Error in py_module_import(module, convert = convert) : 
  ModuleNotFoundError: No module named 'nrgpy'

The only difference is that I used pip because I'm using python 3.8.5. I also tried with pip3 but I get the same so it doesn't matter.

I really don't know what else to do. Please advice.

Have you configured r-reticulate virtual env to use python 3.8? I think it uses python 2.7 by default unless told otherwise.

I tried with the use_python() but I still get the error.

These are the commands I used

library(reticulate)
use_python(python = "C:/Users/punku/AppData/Local/r-miniconda/envs/r-reticulate/python.exe", required = T)
use_virtualenv("r-reticulate")
nrgpy <- import("nrgpy")

And I get these as results

> library(reticulate)
> use_python(python = "C:/Users/punku/AppData/Local/r-miniconda/envs/r-reticulate/python.exe", required = T)
> use_virtualenv("r-reticulate")
> nrgpy <- import("nrgpy")
Error in py_module_import(module, convert = convert) : 
  ModuleNotFoundError: No module named 'nrgpy'

I installed python through the terminal I have the 3.8 version. My R version is 4.0.0 and RStudio Version 1.3.1073.

When you call use_virtualenv() you are overwriting use_python(), you have to configure your virtual environment to use your desired python version, for example:

virtualenv_create("py3-virtualenv", python = "/usr/bin/python3")
use_virtualenv("py3-virtualenv")

P.D. Sorry for the delayed response, I was sick

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.