I am trying to run HDBSCAN algortihm in R via largeVis package. For visualization of clusters. I am using gplot function in largeVis. Is it possible to change the labels of my data points in the plot from integers to string? I am using Iris dataset with little modification in "class" column and using "class" column as row headers. Is it possible to visualize my current ro
我试图通过largeVis包在R中运行HDBSCAN algortihm。 用于群集的可视化。 我在largeVis中使用gplot函数。 是否可以将图中数据点的标签从整数更改为字符串? 我在“class”列中使用了很少修改的Iris数据集,并将“class”列用作行标题。 是否有可能在图中显示我当前的行标题而不是节点号? x1 <- iris[,-5] row.names(x1) <- paste0("Iris-", iris[,5], " ", 1:nrow(x1)) View(x1) vis <- largeVis::largeVis(x1) cluste
I'm using the formattable package in R to produce a HTML table. I can use formatter to customise the look of data values in in my table eg font-size, color etc. But I can't work out how to alter the appearance of the table header row.I can alter the actual column names using col.names(), but haven't been able to change their appearance. For example, in the table below how can I cha
我在R中使用格式表包生成一个HTML表。 我可以使用格式化程序来定制我的表中的数据值的外观,例如字体大小,颜色等。但我无法弄清楚如何改变表头行的外观。我可以使用col改变实际的列名称.names(),但一直未能改变它们的外观。 例如,在下表中,如何更改标题行中的文本颜色或背景颜色(mpg,cyl,disp等) 最终,我打算使用formattable :: as.htmlwidget()和library(webshot)来获取表格的图像文件,请参阅用于在R中导
I'm using the heatmap3 package for R to generate some gene expression data heatmaps. My question is: how are the values for the gene expression being "mapped" to colours? As an example of the same (reproducible) problem, lets use the example code in the vignette on the mtcars dataset: library(heatmap3) heatmap3(mtcars,scale="col",margins=c(2,10),RowSideColors=RowSideColors,
我使用R的heatmap3软件包来生成一些基因表达数据热图。 我的问题是:基因表达的价值如何被“映射”为颜色? 作为相同(可重现)问题的示例,让我们使用mtcars数据集上的小插图中的示例代码: library(heatmap3) heatmap3(mtcars,scale="col",margins=c(2,10),RowSideColors=RowSideColors, balanceColor = TRUE) 图例显示颜色范围从大约-2到加3.如果我们使用玛莎拉蒂宝来作为例子 mpg cyl disp hp drat wt qsec vs am g
I am having an issue producing a side-by-side bar plot of two datasets in R. I previously used the code below to create a plot which had corresponding bars from each of two datasets juxtaposed side by side, with columns from dataset 1 colored red and from dataset 2 colored blue. Now when I run the same code on any pair of datasets, including the originals which are still untouched in my saved wo
我有一个问题在R中产生了两个数据集的并排条形图。我之前使用下面的代码创建了一个绘图,其中并排排列了两个数据集中的每个数据集的对应条形图,其中来自数据集1的列着色红色和来自数据集2的颜色为蓝色。 现在,当我在任何一对数据集上运行相同的代码时,包括原始数据在我保存的工作区中仍未触及的情况下,我会为每个数据集并排分别绘制图表,其中各列之间的红色和蓝色交替显示,数据集。 文档并没有给我(我)任何(显而易见
My dataset for chrom 1 looks something like this head(data) SNP BP P Dataset LD 1 SNP1 541095 0.00529 expression 0.000610863 2 SNP2 541095 0.07897 original 0.066610863 3 SNP3 541133 0.21990 original 0.040534557 4 SNP4 541233 0.47890 expression 0.008216450 5 SNP5 541260 0.39790 original 0.010310200 6 SNP6 541260 0.19210 expression 0.000390915 7 SNP7 541265 0.0
我的铬1数据集看起来像这样 head(data) SNP BP P Dataset LD 1 SNP1 541095 0.00529 expression 0.000610863 2 SNP2 541095 0.07897 original 0.066610863 3 SNP3 541133 0.21990 original 0.040534557 4 SNP4 541233 0.47890 expression 0.008216450 5 SNP5 541260 0.39790 original 0.010310200 6 SNP6 541260 0.19210 expression 0.000390915 7 SNP7 541265 0.000001 original 1 7 SNP
I have a list of multiple regressions completed via this code using the standard dataset mtcars . models <- lapply(paste("mpg", names(mtcars)[-1], sep = "~"), formula) res.models <- lapply(models, FUN = function(x) {summary(lm(formula = x, data = mtcars))}) names(res.models) <- paste("mpg", names(mtcars)[-1], sep = "~") Where I now have a list of multiple regressions against the first
我有一个使用标准数据集mtcars通过此代码完成的多个回归列表。 models <- lapply(paste("mpg", names(mtcars)[-1], sep = "~"), formula) res.models <- lapply(models, FUN = function(x) {summary(lm(formula = x, data = mtcars))}) names(res.models) <- paste("mpg", names(mtcars)[-1], sep = "~") 我现在在哪里有第一列“mpg”的多个回归列表。 从这里我试图导出某些汇总统计信息,如; 截距,系数和r.squared
Take the example of mtcars in R: I want to make a non linear regression for the relationship between mpg and disp for each cylinder and each group of vs. In my case I have a dataframe much bigger than mtcars. I know there is not enough data. But to simplify the question, I will always use mtcars but suppose that we have sufficiant data to make multiple group non-linear regression and the formul
以R中的mtcars为例:我想对每个柱面和每个组的mpg和disp之间的关系进行非线性回归。在我的情况下,我有一个比mtcars大得多的数据框。 我知道没有足够的数据。 但为了简化问题,我总是使用mtcars,但假设我们有足够的数据来进行多组非线性回归,公式是tanh类型。 我想对每个cyl和每个vs组进行tanh类型回归,所以我尝试了: mtcars2 <-list() reg2 <-list() attach(mtcars) for (i in levels(cyl)) { mtcars2[[i]] &l
I am connecting to a SQL Server using ODBC and want to create a table from a dataframe. Following RODBC vignette below is my code, library(RODBC) channel <- odbcConnect("DSN#", uid = "uname", pwd = "pwd") ana.cars.df <- data.frame(mtcars) sqlSave(channel, ana.cars.df) And below is the error that I am getting Error in sqlSave(channel, ana.cars.df) : 42000 102 [FreeTDS][SQL Server]Incor
我使用ODBC连接到SQL Server,并希望从数据框创建表。 下面的RODBC vignette是我的代码, library(RODBC) channel <- odbcConnect("DSN#", uid = "uname", pwd = "pwd") ana.cars.df <- data.frame(mtcars) sqlSave(channel, ana.cars.df) 以下是我得到的错误 错误sqlSave(channel,ana.cars.df):42000 102 [FreeTDS] [SQL Server]'rownames'附近语法不正确。 [RODBC]错误:无法执行SQLExecDirect'C
I am trying to calculate a non-linear regression for my data in R. I am having trouble finding an appropriate formula and parameter values. My data looks like this: I have been using the nls and nlrq functions, which I believe to be suitable, but I think the formulas I specify are not appropriate. I have tried the exponential decay function y ~ ab^x and y ~ c + a*b^x , but the resulting regr
我试图为R中的数据计算非线性回归。我无法找到合适的公式和参数值。 我的数据如下所示: 我一直在使用我认为合适的nls和nlrq函数,但我认为我指定的公式并不合适。 我已经尝试了指数衰减函数y ~ ab^x和y ~ c + a*b^x ,但是由此产生的回归线根本看起来不正确。 不幸的是,我不知道哪种配方是合适的。 我已经通过一些教程来拟合非线性回归,但他们都是从一个初始公式开始的,这个初始公式似乎适合他们的数据集。 这里的
As part of my data analysis (on time series), I am checking for correlation between log-returns and realized volatility. My data consists of time series spanning several years for around hundred different companies (large zoo object, ~2 MB filesize). To check for the above-mentioned correlation, I have used the following code to calculate several rolling variances (aka realized volatility): r
作为我的数据分析的一部分(按时间序列),我正在检查对数收益与已实现波动率之间的相关性。 我的数据由跨越数百个不同公司(大型动物园对象,〜2 MB文件大小)的时间序列组成。 为了检查上述相关性,我使用下面的代码来计算几个滚动变化(又名已实现的波动性): rollvar5 <- sapply(returns, rollVar, n=5, na.rm=TRUE) rollvar10 <- sapply(returns, rollVar, n=10, na.rm=TRUE) 使用简单的fTrading函数rollVar。