我安装了新的R 3.1.3.我现在在启动时收到错误:
Error in .rs.httpdPort() : attempt to apply non-function
Run Code Online (Sandbox Code Playgroud)
帮助不起作用.例如:
?get
Run Code Online (Sandbox Code Playgroud)
重定向到我的浏览器.
有什么想法可以做些什么吗?
我用的"7 x64" "build 7601, Service Pack 1"是Windows x86-64
最好的祝福
我有一个df:
head(hej3)
Year variable N Sum Mean sd Variance Median Min Max
1 1901 Delägare.män. 85 18089 212.81176 365.39168 133511.083 110.0 5 2771
2 1901 Delägare.kvinnor. 48 3509 73.10417 97.84209 9573.074 34.5 1 414
3 1902 Delägare.män. 92 19783 215.03261 363.63529 132230.625 111.5 2 2827
4 1902 Delägare.kvinnor. 53 3872 73.05660 94.12827 8860.131 40.0 1 408
5 1903 Delägare.män. 99 21123 213.36364 366.58411 134383.907 109.0 2 2994
6 1903 Delägare.kvinnor. 55 4201 76.38182 93.85006 8807.833 40.0 1 390
dput(hej3)
structure(list(Year …Run Code Online (Sandbox Code Playgroud) 我怎么能把字符串转换"2015-02-02"为ISODate 2015-02-02T00:00:00.000Z?我试图找到一些例子,但没有.
我有以下代码:
var request = require('request');
var cheerio = require ("cheerio");
var async= require("async");
var MyLink="www.mylink.com";
async.series([
function(callback){
request(Mylink, function (error, response, body) {
if (error) return callback(error);
var $ = cheerio.load(body);
//Some calculations where I get NewUrl variable...
TheUrl=NewUrl;
callback();
});
},
function(callback){
for (var i = 0; i <=TheUrl.length-1; i++) {
var url = 'www.myurl.com='+TheUrl[i];
request(url, function(error, resp, body) {
if (error) return callback(error);
var $ = cheerio.load(body);
//Some calculations again...
callback();
});
};
}
], function(error){
if (error) …Run Code Online (Sandbox Code Playgroud) 是否可以在Windows机器上安装RStudio Server?我知道如果我使用AMI是可能的,但是如何在没有AMI的情况下安装它?
"这主要是Windows下的一个问题,你需要安装Cygwin来运行X服务器(假设使用putty进行ssh连接).尽管它有效,但我真的不喜欢安装很多额外的软件来获取与图形支持的远程连接."
但我不明白......任何想法?
我尝试Path.join在这样的require语句中使用:
import Path from 'path'
const assetPath = Path.join(process.cwd(), `./lib/asset-manifest.json`)
console.log(assetPath)
'/home/dev/Website/lib/asset-manifest.json'
console.log(
assetPath === '/home/dev/Website/lib/asset-manifest.json'
)
true
const assets = require(assetPath)
Run Code Online (Sandbox Code Playgroud)
但这会引发错误:
Error: Cannot find module '/home/dev/Website/lib/asset-manifest.json'
Run Code Online (Sandbox Code Playgroud)
虽然文件在那里并且require如果我手动将字符串放入其中可以工作:
const assets = require('/home/dev/Website/lib/asset-manifest.json')
Run Code Online (Sandbox Code Playgroud)
所以,我不知道为什么没有Path.join在工作require?
此致
我有下面的代码,我想setTimeout在每次迭代之间放一个Myurl.有许多,classes每个都包含许多元素.
//Some calculations before...
var i = 0;
async.whilst(
function () {
return i <= thefooz.length - 1;
},
function (innerCallback) {
//Some calculations where I get classes array.
async.forEachOfSeries(classes, function (Myurl, m, eachDone) {
// Here I want a delay
async.waterfall([
function (next) {
connection.query(
'SELECT * FROM mydata WHERE UrlLink=? LIMIT 1', [Myurl],
next
);
},
function (results, fields, next) {
if (results.length !== 0) {
console.log("Already Present");
return next();
}
console.log("New …Run Code Online (Sandbox Code Playgroud) 我有一个df(一个pdata.frame对象):
head(df) :
Company Year Kapitalinkomster Bank.o.kassa Obligationer Lån Aktier Placeringar.andra.ftg Fodringar Reala.tillgångar
5-1948 5 1948 4.009780 0.8677505 40.12268 54.80897 1.4630271422 0.049855191 0.633959879 1.581139e+00
6-1948 6 1948 3.221688 0.9311173 71.16401 26.39038 0.4678139417 0.000000000 0.437931676 4.931845e-01
12-1948 12 1948 3.136025 0.7628832 46.10452 44.85120 4.1966304368 0.003740003 1.020092197 2.683785e+00
19-1948 19 1948 1.862666 0.1865510 16.82441 31.67412 0.7308074302 46.245334945 3.459693951 6.213455e-01
20-1948 20 1948 3.724516 1.7719721 70.98456 27.18631 0.0004305687 0.056565968 0.000165769 4.305687e-07
21-1948 21 1948 11.288744 1.1572048 64.21109 33.42962 0.2890377378 0.000000000 0.912175552 …Run Code Online (Sandbox Code Playgroud) 我想知道是否可以immer.js在一次“调用”中更新多个状态属性。
说我有state:
export const initialState = {
isUserLogged: false,
menuIsClosed: false,
mobileMenuIsClosed: true,
dataArray: ["dog","cat"],
};
Run Code Online (Sandbox Code Playgroud)
并且action creator:
export function updateSearchPage(data) {
return {
type: UPDATE_SEARCH_PAGE,
payload: data
};
}
Run Code Online (Sandbox Code Playgroud)
然后我action creator在 React 组件中使用它,如下所示:
this.props.updateSearchPage({
isUserLogged: true,
menuIsClosed: true,
dataArray: ["dog","cat","owl"]
})
Run Code Online (Sandbox Code Playgroud)
这个想法是我想同时更新状态的几个属性。但我不知道它是哪些属性提前。我知道如何用一个简单的减速器来做到这一点:
case UPDATE_SEARCH_PAGE:
return Object.assign({}, state, action.payload)
Run Code Online (Sandbox Code Playgroud)
但是how to update several properties of state with immer at the same time?当状态属性(应该更新哪个)事先未知时。
我做了一个doubleYScale情节:
library(lattice)
library(latticeExtra)
# Some data
foo <- list(x = 1:100, y = cumsum(rnorm(100)))
obj1 <- xyplot(y~ x, data=foo,xlab=list(cex=1.2),
main="TOtalProduktion VS SummaSkulder/TotaltKapital i procent",
type = c("l","g"),col="black",
lty=1,key = simpleKey(col=c('black'),
text=c("Produktion"),cex=1.2,points=FALSE, lines=TRUE),
scales=list(x=list(rot=90,tick.number=25,
cex=1,axs="r")))
obj2 <- xyplot(y^2 ~ x,data= foo ,type = "o",col="black",
lty=9,key = simpleKey(col=c('black'),
text=c("Summa.skulder"),cex=1.2,lines=FALSE,points= TRUE))
doubleYScale(obj1, obj2, add.ylab2 = TRUE)
Run Code Online (Sandbox Code Playgroud)

这problem是我无法改变y轴标签的文本大小(y和y^2文本,我想让它更大).如果我只绘制obj1或obj2单独绘制它是没有问题,但它不适用于doubleYScale......
另一方面,我可以使用以下方法更改y轴上的数字大小:
trellis.par.set(axis.text=list(cex=1))
Run Code Online (Sandbox Code Playgroud)
有什么建议?我找不到办法:(