Watts-College / cpp-527-spr-2022

https://watts-college.github.io/cpp-527-spr-2022/
0 stars 1 forks source link

Final Project: salary-report.rmd - Cannot open the connection error #37

Open trioptre opened 2 years ago

trioptre commented 2 years ago

Hello -

I'm getting the error: "Error in file(file, "rt") : cannot open the connection"

after running the following code:

LOAD DATA

URL <- params$url d <- read.csv( URL )

Any suggestions?

Code from the beginning of the .rmd:

params: url: value: x

Example Report Assets Section

knitr::opts_chunk$set( echo = TRUE, message=F, warning=F )

# Hide all of the extra messages and code in the final report:
#
#   knitr::opts_chunk$set( echo=F, message=F, warning=F )
#

library( dplyr )
library( pander )
library( knitr )
library( gender )
library( params )

# SOURCE CUSTOM FUNCTIONS
source( "utils.R" )

# LOAD DATA
URL <- params$url
d <- read.csv( URL )
Dselby86 commented 2 years ago

If you were to print the URL object, what does it say?

You have to make sure it is referencing a file path that leads to a csv file.

On Thu, Feb 24, 2022 at 9:53 PM trioptre @.***> wrote:

Hello -

I'm getting the error: "Error in file(file, "rt") : cannot open the connection"

after running the following code:

LOAD DATA

URL <- params$url d <- read.csv( URL )

Any suggestions? Code from the beginning of the .rmd: params: url: value: x Example Report Assets Section

knitr::opts_chunk$set( echo = TRUE, message=F, warning=F )

Hide all of the extra messages and code in the final report:

#

knitr::opts_chunk$set( echo=F, message=F, warning=F )

#

library( dplyr ) library( pander ) library( knitr ) library( gender ) library( params )

SOURCE CUSTOM FUNCTIONS

source( "utils.R" )

LOAD DATA

URL <- params$url d <- read.csv( URL )

— Reply to this email directly, view it on GitHub https://github.com/Watts-College/cpp-527-spr-2022/issues/37, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB4EHB5LFO5JEPWADVPV2FDU44DL5ANCNFSM5PJIM57Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you are subscribed to this thread.Message ID: @.***>

trioptre commented 2 years ago

@Dselby86 - when I print URL, the result is "x". Anything I put as the value: in the YAML header prints when I enter "URL".

I've tried url.2019 and url.2020, but no luck.

Any suggestions?

trioptre commented 2 years ago

@Dselby86 - Unfortunately, I was never able to get past this error message, which precluded me from having a functional project.

Dselby86 commented 2 years ago

The line: d <- read.csv( URL ) is using the value of URL to determine the location of the file to read. So in the Yaml what follows value should be the file address you are trying to access. params: url: value: x

On Sun, Feb 27, 2022 at 11:18 PM trioptre @.***> wrote:

@Dselby86 https://github.com/Dselby86 - Unfortunately, I was never able to get past this error message, which precluded me from having a functional project.

— Reply to this email directly, view it on GitHub https://github.com/Watts-College/cpp-527-spr-2022/issues/37#issuecomment-1053927749, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB4EHB5EMZGOH6SBJK3CJ4TU5MHTBANCNFSM5PJIM57Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

trioptre commented 2 years ago

Thank you @deslby ; is the file address the same as the file path? I'm still not understanding...

Dselby86 commented 2 years ago

Yes. The file path and file address are the same thing.

On Mon, Feb 28, 2022, 8:23 PM trioptre @.***> wrote:

Thank you @deslby ; is the file address the same as the file path? I'm still not understanding...

— Reply to this email directly, view it on GitHub https://github.com/Watts-College/cpp-527-spr-2022/issues/37#issuecomment-1054959849, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB4EHB4LOJLQPFPZVXHWGN3U5Q3ZRANCNFSM5PJIM57Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>