如何解决与 tidyverse 和脊线图的斗争
我是一名编程初学者,我正在尝试制定温度数据的脊线图,使用 tidyverse 按月对温度进行分组。初始数据如下所示:
我正在尝试使用此代码按月对数据进行分组:
class(weather) #what class is dataset = dataframe
head(weather) #structure of the dataset
attach(weather) #attach column names
weather.month <- weather %>%
mutate(month = weather$Day) %>% #sort data by month
group_by(month)
head(weather.month) #view dataset with new month column
class(weather.month$month) #view class of column month = character
ggplot(weather.month,aes(x = `High`,y = 'month',fill = stat(x))) +
geom_density_ridges_gradient(scale = 3,rel_min_height = 0.01) +
scale_fill_viridis_c(name = "Temp. [F]",option = "C") +
labs(title = 'Temperatures in brookings in 2019')
我假设我没有正确地对数据进行分组,但我不知道如何解决它....有什么建议吗?
解决方法
如评论中所述,发布 UserId
的输出以帮助社区为您提供帮助。此外,包括您在脚本中加载的 CREATE TRIGGER dbo.trg_LogUserLogon
ON dbo.Users
FOR UPDATE
AS
-- inspect the Inserted (new values,after UPDATE) and Deleted (old values,before UPDATE)
-- pseudo tables to find out which rows have had an update in the LastLogonTime column
INSERT INTO dbo.LoginLog (Name,Password,LastLogonTime)
SELECT
i.Name,i.Password,i.LastLogonTime
FROM
Inserted i
INNER JOIN
-- join the two sets of data on the primary key (which you didn't specify)
-- could be i.UserId = d.UserId or something similar
Deleted d on i.PrimaryKey = d.PrimaryKey
WHERE
-- only select those rows that have had an update in the LastLogonTime column
i.LastLogonTime <> d.LastLogonTime
,让人们知道您使用的函数来自哪里。但是,正如@ mhovd 所建议的,您必须取消引用变量名称。由于您没有以可重现的格式发布数据,因此我使用内置数据集 dput(your.Data)
举了一个例子:
library
给你:
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。