Forum Discussion

StatsChick's avatar
StatsChick
Frequent Visitor
2 years ago

Connect to R: Error Message -- Error: Object "Data.R" not Found

I have followed some posts on fixing this issue, including adding a .libpaths() command to the R script. I get the same error -- not only complaining of the memory limit issue but also "Data.R" not found. See my script below. Is there a better way to fix this?

 

# The following code to create a dataframe and remove duplicated rows is always executed and acts as a preamble for your script:

#dataset <- data.frame(DonorID, Gift_Amount, Gift_Date)
# dataset <- unique(dataset)

# Paste or type your script code here:
library(tidytext)
library(data.table)
library(rfm)
library("stringr", lib.loc="C:/Program Files/R/R-4.3.1/library")


.libPaths("C:/Program Files/R/R-4.3.1/library")


giftData<-data.frame(DonorID, Gift_Amount, Gift_Date)

giftData$giftDate<-as.Date(giftData$date, "%m/%d/%Y")
analysis_date<-as.Date("2023-11-12")
giftData$RecencyDays<-as.numeric(analysis_date-giftData$giftDate)

RFMData<-giftData[which(!is.na(giftData$Pledged)),]
RFMData<-RFMData[which(RFMData$RecencyDays>0),]

rfm_score<-rfm_table_order(RFMData, Prospect.ID, giftDate, Pledged, analysis_date,5,5,5 )

View(rfm_score)
 
 

2 Replies