Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi. When I run the R script for word cloud I get this:
Error Message:
Error del script R.
Error in `[.data.frame`(data, , 1:2) : undefined columns selected
Calls: wordcloud2 -> [ -> [.data.frame
the dataset contains one word per row
library(wordcloud2)
wordcloud2(dataset, size = 2, color = "random-light", backgroundColor = "grey")
wordcloud2(dataset, size = 2, minRotation = -pi/6, maxRotation = -pi/6, rotateRatio = 1)
Any suggestions please?
Thank you very much
Solved! Go to Solution.
Hi @Syndicate_Admin ,
Error in `[.data.frame`(data, , 1:2) : undefined columns selected
According to your error message, I think your error should be casued by Data[...,...] part. As far as I know, data function should look like as below.
data[rows you want, columns you want]
I think you only want to return first two columns based on your code. Please try below code.
data[data,1:2]
For reference:
How to Handle “undefined columns selected” in R
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Syndicate_Admin ,
Error in `[.data.frame`(data, , 1:2) : undefined columns selected
According to your error message, I think your error should be casued by Data[...,...] part. As far as I know, data function should look like as below.
data[rows you want, columns you want]
I think you only want to return first two columns based on your code. Please try below code.
data[data,1:2]
For reference:
How to Handle “undefined columns selected” in R
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
79 | |
78 | |
57 | |
37 | |
34 |
User | Count |
---|---|
99 | |
56 | |
56 | |
46 | |
40 |