rxHistogram returns error: The element bIsPrediction does not exist in the list - revolution-r

I have Revolution R Enterprise 8.0 with RRO 3.2.2 installed and try to run a simple example - make a histogram from Titanic dataset:
library("RevoScaleR")
dataCsv <- read.csv("http://s3.amazonaws.com/assets.datacamp.com/course/Kaggle/train.csv")
dataXdf <- file.path("titanic.xdf")
rxImport(inData = dataCsv, outFile = dataXdf, overwrite = TRUE)
rxHistogram( ~ Age, data = dataXdf, xAxisMinMax = c(0, 520), numBreaks = 100, xNumTicks = 10)
and rxHistogram returns mystic error:
Error in doTryCatch(return(expr), name, parentenv, handler) :
The element bIsPrediction does not exist in the list.
Anybody knows how to fix it and what is actually the problem? Googling didn't give any results.
PS: hit the same error running rxDataStep

Problem was solved by uninstalling Revolution R and installing it back again.

Related

I got the Error in `arrange()` message, how to solve it?

res_prim = output$res
df_age = res_prim %>%
dplyr::select(taxon, ends_with("age"))
df_fig_age = df_age %>%
filter(df_age == 1) %>%
arrange(desc(lfc_age)) %>%
mutate(direct = ifelse(lfc_age > 0, "Positive LFC", "Negative LFC"))
Error in arrange():
! Problem with the implicit transmute() step.
✖ Problem while computing ..1 = lfc_age.
Caused by error in mask$eval_all_mutate():
! object 'lfc_age' not found
Run rlang::last_error() to see where the error occurred.
rlang::last_error()
Error: object 'rlang::last_error()' not found
rlang::last_error()
<error/rlang_error>
Error in arrange():
! Problem with the implicit transmute() step.
✖ Problem while computing ..1 = lfc_age.
Caused by error in mask$eval_all_mutate():
! object 'lfc_age' not found
Backtrace:
... %>% ...
base::.handleSimpleError(...)
dplyr (local) h(simpleError(msg, call))
Run rlang::last_trace() to see the full context.
I get the above error messages and not sure how to fix it. Please let me know what to do to get rid of the error.
Thank you very much, PAR
Looked in the internet but could not find an answer

Sparklyr : sql temporary error : argument is not interpretable as logical

Hi I'm new to sparklyr and I'm essentially running a query to create a temporary object in spark.
The code is something like
ts_data<-tbl(sc,"db.table") %>% filter(condition) %>% compute("ts_data")
sc is my spark connection.
I have run the same code before and it works but now I get the following error.
Error in if (temporary) sql("TEMPORARY ") : argument is not
interpretable as logical
I have tried changing filters, tried it with new tables, R versions and snapshots. Yet it still gives the same exact error. I am positive there are no syntax errors
Can someone help me understand how to fix this?
I ran into the same problem. Changing compute("x") to compute(name = "x") fixed it for me.
This was a bug of sparklyr, and is fixed with version 1.7.0. So either use matching by argument (name = x) or update your sparklyr version.

Error in data frame creation in R in Spark using as.data.frame

I am trying to convert SparkDataFrame to R data frame.
%python
temp_df.createOrReplaceTempView("temp_df_r")
%r
temp_sql = sql("select * from temp_df_r")
temp_r = as.data.frame(temp_sql)
Error in as.data.frame.default(temp_sql) :
cannot coerce class ‘structure("SparkDataFrame", package = "SparkR")’ to a data.frame
Sometimes I get error, it's still unknown why I get error sometimes and sometimes not.
I need more details. What environment do you use?

R wont knit to html or pdf with SQL chunks. Error in eval(x, envir = envir) : object 'connection' not found

connection <- dbConnect(RSQLite::SQLite(), "AmericasCup.sqlite")
dbWriteTable(connection, "results", results, overwrite=TRUE)
```{sql connection=connection, output.var = "outQ6"}
SELECT Code,
SUM(Result = 'Win' ) AS Wins,
SUM(Result = 'Loss') AS Losses
FROM results
GROUP BY Code
Everything runs fine but when I try knit to html or pdf I get the following error:
Line 79 is: SELECT Code,
Can anyone tell me what the problem is here, I have tried to research this but cant find anything similar, though I suspect it has something to do with my '''{sql connection=connection, output.var - "outQ6"} setup.
Thank you in advance.
I have fixed it, I put this in my r setup instead and now just do {sql} to start sql chunk.
library(RSQLite)
library(DBI)
connection <- dbConnect(RSQLite::SQLite(), "AmericasCup.sqlite")
knitr::opts_chunk$set(connection = "connection")

Failed to connect to BigQuery with Python - ServiceUnavailable

querying data from BigQuery has been working for me. Then I updated my google packages (e. g. google-cloud-bigquery) and suddenly I could no longer download data. Unfortunately, I don't know the old version of the package I was using any more. Now, I'm using version '1.26.1' of google-cloud-bigquery.
Here is my code which was running:
from google.cloud import bigquery
from google.oauth2 import service_account
import pandas as pd
KEY_FILE_LOCATION = "path_to_json"
PROCECT_ID = 'bigquery-123454'
credentials = service_account.Credentials.from_service_account_file(KEY_FILE_LOCATION)
client = bigquery.Client(credentials= credentials,project=PROCECT_ID)
query_job = client.query("""
SELECT
x,
y
FROM
`bigquery-123454.624526435.ga_sessions_*`
WHERE
_TABLE_SUFFIX BETWEEN '20200501' AND '20200502'
""")
results = query_job.result()
df = results.to_dataframe()
Except of the last line df = results.to_dataframe() the code works perfectly. Now I get a weired error which consists of three parts:
Part 1:
_InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.UNAVAILABLE
details = "failed to connect to all addresses"
debug_error_string = "{"created":"#1596627109.629000000","description":"Failed to pick subchannel","file":"src/core/ext/filters/client_channel/client_channel.cc","file_line":3948,"referenced_errors":[{"created":"#1596627109.629000000","description":"failed to connect to all addresses","file":"src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc","file_line":394,"grpc_status":14}]}"
>
Part 2:
ServiceUnavailable: 503 failed to connect to all addresses
Part 3:
RetryError: Deadline of 600.0s exceeded while calling functools.partial(<function _wrap_unary_errors.<locals>.error_remapped_callable at 0x0000000010BD3C80>, table_reference {
project_id: "bigquery-123454"
dataset_id: "_a0003e6c1ab4h23rfaf0d9cf49ac0e90083ca349e"
table_id: "anon2d0jth_f891_40f5_8c63_76e21ab5b6f5"
}
requested_streams: 1
read_options {
}
format: ARROW
parent: "projects/bigquery-123454"
, metadata=[('x-goog-request-params', 'table_reference.project_id=bigquery-123454&table_reference.dataset_id=_a0003e6c1abanaw4egacf0d9cf49ac0e90083ca349e'), ('x-goog-api-client', 'gl-python/3.7.3 grpc/1.30.0 gax/1.22.0 gapic/1.0.0')]), last exception: 503 failed to connect to all addresses
I don't have an explanation for this error. I don't think it has something to do with me updating the packages.
Once I had problems with the proxy but these problems caused another/different error.
My colleague said that the project "bigquery-123454" is still available in BigQuery.
Any ideas?
Thanks for your help in advance!
503 error occurs when there is a network issue. Try again after some time or retry the job.
You can read more about the error on Google Cloud Page
I found the answer:
After downgrading the package "google-cloud-bigquery" from version 1.26.1 to 1.18.1 the code worked again! So the new package caused the errors.
I downgraded the package using pip install google-cloud-bigquery==1.18.1 --force-reinstall