小编Pau*_*aul的帖子

有关缺失数据的问题

在矩阵中,如果有一些丢失的数据记录为"NA".

  • 我怎么能删除NA矩阵中的行?
  • 我可以用na.rm吗?

r matrix na

6
推荐指数
3
解决办法
972
查看次数

调试littler/Rscripts

如何调试Rscripts从命令行运行?

我目前正在使用该getopt包来传递命令行选项,当出现错误时我很难,我很难:

  1. 看看究竟出了什么问题;
  2. 以交互方式调试R(因为脚本需要命令行选项.)

有没有人有示例代码并愿意分享?

debugging r

6
推荐指数
1
解决办法
944
查看次数

R demo()和example()方法?

有没有一种简单的方法来检查,如果R functionspackagesdemo()example()方法呢?

当建立一个包,就包需要有这样的必要的对象demo(),并example()可以在它被称为?

编辑:在尝试回答这个问题时,我检查了源代码demo()

demo(package = .packages(all.available = TRUE)) # check which packages have demo
Run Code Online (Sandbox Code Playgroud)

r

6
推荐指数
1
解决办法
5814
查看次数

r 闪亮:来自 www 的 renderImage

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)

r shiny

6
推荐指数
1
解决办法
6106
查看次数

无法从docker内部访问mongo

我试图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)

java mongodb docker

6
推荐指数
2
解决办法
9884
查看次数

将非8dot3目录路径的短名称扩展为长名称

Ron中Windows,tempdir()返回包含短名称的路径non 8dot3 directory names.

如何将它们扩展为长名称?

使用纯R代码的答案是有利的,但使用通过使用的众所周知的shell命令的答案system()很好作为备份.

r long-filenames

5
推荐指数
1
解决办法
626
查看次数

r 闪亮:访问 UI 中的输入字段

我试图从 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 的输入?

user-interface r input shiny

5
推荐指数
1
解决办法
4107
查看次数

hibernate - 无法执行语句; SQL [n/a] - 保存嵌套对象

我正在尝试使用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)

java hibernate exception save hsqldb

5
推荐指数
1
解决办法
3万
查看次数

ReferenceError:使用angular-google-maps时未定义_

我得到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.jsindex.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 ApiGoogle Developer Console

有人有这个图书馆的经验,可以给我一个提示吗?

javascript google-maps angularjs

5
推荐指数
1
解决办法
2672
查看次数

代码停止执行另一个代码

我有一个R代码,可以进行一些数据分析和返回TRUE/FALSE.有时,输入数据太大而代码只是保持运行.

我想要一个监视我的数据分析代码的脚本,如果它没有返回任何内容600 seconds,那么它会暂停正在运行的代码并执行其他操作.

这就像按下STOP按钮一样R console.

我知道stop,break,exit,等,但因为代码将无法达到这些语句,因为它仍在运行,它的数据分析,这些循环不会是有用的.

r halt exit

5
推荐指数
1
解决办法
192
查看次数