英文:
My R shiny script copies the points to google sheets as "string" and i need points to be in integer format
问题
我创建了一个应用程序,将数据收集到Google表格中。一个文本“名字”和一个数字“分数”。在Google表格中,分数会以带有数字之前的单引号字符串的形式出现。我希望用户能立即看到分数,以便图表可以捕捉它们。
目前在Google表格中添加了第三列,将文本转换为值。这并不理想。
这是应用程序代码的链接:https://github.com/Nxatha/Rshiny-apps/blob/main/trashketballstats.R
在这里输入数据以查看输出:https://nxatha.shinyapps.io/TrashketballChallenge/
我尝试使用as.numeric将分数强制转换为数字,但在Google表格中仍然显示为文本'数字。
英文:
I created an app that collects data to google sheets. a text "name" and a number "points". On google sheets, points appears as a string with ' before the number. I would like the user to immediately see points so that the chart can pick them up .
Currently added a third column in google sheets to convert text to value. Not ideal.
Here is the link to the app code: https://github.com/Nxatha/Rshiny-apps/blob/main/trashketballstats.R
Enter data here to view output: https://nxatha.shinyapps.io/TrashketballChallenge/
i tried using as.numeric to force the points into numeric but still appears on google sheet as text 'number
答案1
得分: 0
你似乎正在进行cbinding操作,因此将变量强制转换为最常见的类型,即字符型。
考虑并比较
cbind(a=1, b="x")
data.frame(a=1, b="x")
英文:
You seem to be cbinding, and so getting variables coerced to the most common type, i.e character.
consider and compare
cbind(a=1,b="x")
data.frame(a=1,b="x")
</details>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论