Error in translateR package - r

I am trying to convert a text from French to English using translate function in translateR package. I am using MS translator. Could anybody help me to solve this? I am new to R language and don't have much expertise into this.
This code:
text1 <- "joyeux Noël"
translate(content.vec=text1, microsoft.client.id='xxxxxx',
microsoft.client.sec‌ret = 'ZlZ39GooG6w1oiDlUgPcUQXGq7B+jCfchdrL9h0ebz8=',
source.lang = 'fr', target.lang = '‌​en')
Throws:
Error in fromJSON(postForm("https://datamarket.accesscontrol.windows.net/v2/OAuth2-13", :
error in evaluating the argument 'content' in selecting a method for function 'fromJSON': Error in function (type, msg, asError = TRUE) :
Failed to connect to datamarket.accesscontrol.windows.net port 443: Connection refused

Related

Error when trying to prase a HTTP-Request in R

im using R package httr to get a HTTP-Response for a specific link.
When trying to parse the content of the response im getting the Error:
Fehler in parse(text = script_content) : <text>:1:10: Unerwartete(s) '['
1: {"lines":[
Translated to enlgish it says something like this (sorry for my error messages being in German):
Error in parsing(text = script_content) : <text>1:10: Unexpected '['
1: {"lines":[
It seems as there is a problem with the format/encoding of the text. Here is my code:
script <-
GET(
url = "https://my_url.which_origin_is_not_important/my_script.R",
authenticate(username, pass)
)
script_content <- content(script, as = "text", encoding = "ISO-8859-1")
parsed_condent <- parse(text = script_content )
The value of script_content looks like this:
"{\"lines\":[{\"text\":\"################## FUNCTION ##################\"},{\"text\":\"\"},{\"text\":\"library(log4r)\"}],\"start\":0,\"size\":32,\"isLastPage\":true,\"limit\":500,\"nextPageStart\":null}"
Some more background to this operation: Im trying to source a code, which is currently inside of a private repository. I wrote the code myself i'm trying to source. I made sure, that the issue is not coming from within th code.
I got the solution from: Sourcing R files in a private github folder
Thanks for any advice!!

Error while using write_xes function : Error in defaultvalues[[datatype]] : invalid subscript type 'list'

I want to export an eventlog object built in R using bupaR package function - eventlog as an xes file. For that I am using function write_xes() of package xesreadR. But the function is giving out error :
Error in defaultvalues[[datatype]] : invalid subscript type 'list'
>class(log)
output:
[1] "eventlog" "tbl_df" "tbl" "data.frame"
write_xes(log,"myxes.xes")
According to the documentation it should save the log to the destined file.But instead it is producing the error :
ERROR : Error in defaultvalues[[datatype]] : invalid subscript type
'list'
I have tried multiple things to troubleshoot this problem but haven't came up with a solution. So can somebody help me to solve this error. Thank You!
Your function is defined as follow:
write_xes ( eventlog, case_attributes = NULL, file = file.choose())
Thus, writing
write_xes(log,"myxes.xes")
means
write_xes(eventlog = log, case_attributes = "myxes.xes").
Instead, you shall write
write_xes(eventlog = log, file = "myxes.xes")

Error in function (type, msg, asError = TRUE) : Could not resolve host: datamarket.accesscontrol.windows.net

I am trying to convert a text from French to English using translate
function in translateR package. I am using MS translator. Could
anybody help me to solve this? I am new to R language and don't have
much expertise into this.
This code:
library(translateR)
res <- translate(content.vec = c("Hello world.", "This is a test."),
microsoft.client.id = "143bc77b-80fd-4a71-ae9d-7e37373fd84c",
microsoft.client.secret = "biAW515)[jpbulULGTK11$+",
source.lang = "en",
target.lang = "de")
res
Throws error:
Error in function (type, msg, asError = TRUE) :
Could not resolve host: datamarket.accesscontrol.windows.net
In addition: Warning message:
The content appears to be in MIDDLE_FRISIAN. However, the language code you provided suggests that
the text is in ENGLISH. If you entered the wrong language code, stop the process. Otherwise,
translateR will treat the text as ENGLISH.

Error in getGEO command in GEOquery

I`m running the following commands to get the data from GEO
library(GEOquery)
gset <- getGEO("GSE9476", GSEMatrix =TRUE, AnnotGPL=TRUE)
But, faced the following error
https://ftp.ncbi.nlm.nih.gov/geo/series/GSE9nnn/GSE9476/matrix/
Error in function (type, msg, asError = TRUE) :
error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version

Move remote file in SFTP using R and RCurl

I need to rename a remote file once I download them. I tried to use the following command, but its not working.
input = getURL(url, userpwd="user:password", postquote=c("/inputs/", "RNFR abc.xml", "RNTO abc.xml_processed"))
This is throwing the error message
Error in function (type, msg, asError = TRUE) : Unknown SFTP command
Please somebody suggest me some insight into this.
Update
I tried with the complete paths like,
input = getURL("url/abc.xml", userpwd="user:password", postquote=c("RNFR /inputs//abc.xml", "RNTO /inputs/abc.xml_processed"))
Still same error Error in function (type, msg, asError = TRUE) : Unknown SFTP command.

Resources