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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

R Script Error "object not found"

Hi Experts

 

I am getting the following erro on this simple bit of R Script, canot see what i have done wrong (see image with error message below)

Capture.PNG
Sheet1 <- data.frame(PRIMARYTOOUTCOMEYEARS, OUTCOMETYPE)
Sheet1 <- unique(Sheet1)
time_tot <- (PRIMARYTOOUTCOMEYEARS)
num_rev <- (OUTCOMETYPE)

poisson.test(x=num_rev, T=time_tot, conf.level=0.95)
1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

As tested, you don't need to write this code again in the code editor.

Sheet1 <- data.frame(PRIMARYTOOUTCOMEYEARS, OUTCOMETYPE)
Sheet1 <- unique(Sheet1)

 

From you code, it seems it will not plot a visual but calculate the Poisson distribution based on two columns "PRIMARYTOOUTCOMEYEARS, OUTCOMETYPE".

 

If my understanding is correct, you can run R script in Power Query.

 

In addition, there is a function in DAX, does it meet your scenario?

create a new column

Column = POISSON.DIST([PRIMARYTOOUTCOMEYEARS],[OUTCOMETYPE],0.95)

5.png

Reference:

DAX: POISSON.DIST

R:

data.frame

poisson.test

 

Best Regards
Maggie

 

Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

As tested, you don't need to write this code again in the code editor.

Sheet1 <- data.frame(PRIMARYTOOUTCOMEYEARS, OUTCOMETYPE)
Sheet1 <- unique(Sheet1)

 

From you code, it seems it will not plot a visual but calculate the Poisson distribution based on two columns "PRIMARYTOOUTCOMEYEARS, OUTCOMETYPE".

 

If my understanding is correct, you can run R script in Power Query.

 

In addition, there is a function in DAX, does it meet your scenario?

create a new column

Column = POISSON.DIST([PRIMARYTOOUTCOMEYEARS],[OUTCOMETYPE],0.95)

5.png

Reference:

DAX: POISSON.DIST

R:

data.frame

poisson.test

 

Best Regards
Maggie

 

Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

mnay thanks Maggie. Excellent feedback as always. let me test.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.