如何调试Rscripts从命令行运行?
我目前正在使用该getopt包来传递命令行选项,当出现错误时我很难,我很难:
R(因为脚本需要命令行选项.)有没有人有示例代码并愿意分享?
有没有一种简单的方法来检查,如果R functions和packages有demo()和example()方法呢?
当建立一个包,就包需要有这样的必要的对象demo(),并example()可以在它被称为?
编辑:在尝试回答这个问题时,我检查了源代码demo()
demo(package = .packages(all.available = TRUE)) # check which packages have demo
Run Code Online (Sandbox Code Playgroud) renderImage尝试从 Internet 渲染图像时不起作用。当图像在本地机器上时它起作用。
output$myImage <- renderImage({
pfad <- "https://www.rstudio.com/wp-content/uploads/2014/03/blue-125.png"
list(src = pfad,
contentType = 'image/png',
width = 400,
height = 300,
alt = "This is alternate text")
}, deleteFile = F)
imageOutput("myImage")
Run Code Online (Sandbox Code Playgroud) 我试图mongo从 a 内部docker container
访问 当我尝试创建connection.
new MongoClient(host, port)工作中。
mongo也在 a 中运行docker container,我能够连接到它,robomongo并且还在其docker container可以连接之外运行该应用程序mongo
我遇到以下异常
No server chosen by WritableServerSelector from cluster description ClusterDescription{type=UNKNOWN, connectionMode=SINGLE, serverDescriptions=[ServerDescription{address=172.17.0.1:27017, type=UNKNOWN, state=CONNECTING}]}
2017-05-25T21:11:32.277 INFO 5 --- [72.17.0.1:27017] org.mongodb.driver.cluster : Exception in monitor thread while connecting to server 172.17.0.1:27017
com.mongodb.MongoSocketOpenException: Exception opening socket
at com.mongodb.connection.SocketStream.open(SocketStream.java:63)
at com.mongodb.connection.InternalStreamConnection.open(InternalStreamConnection.java:115)
at com.mongodb.connection.DefaultServerMonitor$ServerMonitorRunnable.run(DefaultServerMonitor.java:113)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.net.SocketTimeoutException: connect timed out
at java.net.PlainSocketImpl.socketConnect(Native Method)
at …Run Code Online (Sandbox Code Playgroud) 在Ron中Windows,tempdir()返回包含短名称的路径non 8dot3 directory names.
如何将它们扩展为长名称?
使用纯R代码的答案是有利的,但使用通过使用的众所周知的shell命令的答案system()很好作为备份.
我试图从 sidebarPanel访问mainPanel 中的输入字段,但我无法成功。
代码:
shinyUI(pageWithSidebar{
sidebarPanel(
sliderInput("x", "X", min = 10, max = 100, value = 50)
),
mainPanel(
#this is where I wanna use the input from the sliderInput
#I tried input.x, input$x, paste(input.x)
)
})
Run Code Online (Sandbox Code Playgroud)
似乎问题出在哪里?或者不能在 mainPanel 中使用来自 sidebarPanel 的输入?
我正在尝试使用hibernate保存嵌套对象,我收到了 could not execute statement; SQL [n/a] Exception
码
@Entity
@Table(name = "listing")
@Inheritance(strategy = InheritanceType.JOINED)
public class Listing implements Serializable {
@Id
@Column(name = "listing_id")
private String listingId;
@Column(name = "property_type")
private PropertyType propertyType;
@Column(name = "category")
private Category category;
@Column(name = "price_currency")
private String priceCurrency;
@Column(name = "price_value")
private Double priceValue;
@Column(name = "map_point")
private MapPoint mapPoint;
@Column(name = "commission_fee_info")
private CommissionFeeInfo commissionFeeInfo;
}
public class MapPoint implements Serializable {
private final float latitude;
private final float longitude; …Run Code Online (Sandbox Code Playgroud) 我得到ReferenceError: _ is not defined了角谷歌,地图
我真的不明白为什么我会收到这个错误,因为我正在做它在网站上写的内容.
我也搜索了类似的问题,但他们没有帮助.
bundle.js
$ = window.$ = window.jQuery = require('./lib/jquery');
require('./lib/angular-simple-logger.js');
require('./lib/angular-google-maps.js');
require('./lib/lodash.js');
Run Code Online (Sandbox Code Playgroud)
我是进口bundle.js的index.html.我也试过用ngLodash,但没有结果.
app.js
var app = angular.module('app', [
'ngLodash',
'nemLogging',
'uiGmapgoogle-maps'
]);
app.config(function(uiGmapGoogleMapApiProvider) {
uiGmapGoogleMapApiProvider.configure({
key: '{myKey}',
v: '3.20',
libraries: 'places' // I don't need the whole map, only the places
});
});
Run Code Online (Sandbox Code Playgroud)
我也启用GoogleMaps Api了Google Developer Console
有人有这个图书馆的经验,可以给我一个提示吗?
我有一个R代码,可以进行一些数据分析和返回TRUE/FALSE.有时,输入数据太大而代码只是保持运行.
我想要一个监视我的数据分析代码的脚本,如果它没有返回任何内容600 seconds,那么它会暂停正在运行的代码并执行其他操作.
这就像按下STOP按钮一样R console.
我知道stop,break,exit,等,但因为代码将无法达到这些语句,因为它仍在运行,它的数据分析,这些循环不会是有用的.