Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
hp0709
Frequent Visitor

R Script Error: date_field must be a Date or POSIXt vector ('DATE' is a 'character')

Has someone come across this error. (The insert /edit code sample didnt have R lanaguage so i've pasted it below)

# 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(#_Breaches, DATE)
# dataset <- unique(dataset)

# Paste or type your script code here:

library(NHSRplotthedots)

DATE <- as.Date(dataset$DATE)
ptd_spc(.data = dataset,value_field ="#_Breaches" , date_field = DATE , improvement_direction = "decrease")
 
I'm converting my DATE column in my dataset to date with as.Date(), the script works in R studio but having issues in the R scipt visual. Any ideas what I could do you fix this?
 
 
0 REPLIES 0

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.