1

アプリの作成/デバッグ中に、ページをすばやくテストする必要があります。使っているだけ

install()
opencpu$browser("mypage.html") 

ページが更新されていないように見えるので、十分ではありません。

4

1 に答える 1

1

実際には、インストール後にサーバーを再起動する必要があります。そうしないと、ページが更新されない可能性があります。

私はここ数ヶ月、楽しく取り組んできた次の関数を書きました。

testApp <- function(page="",port="",pkg=gsub("^.*\\/","",getwd())){
    require("opencpu")
    require("devtools")
    document();
    # install the package
    install();
    # restart the server (or it will display cached things)
    opencpu$stop();
    if(port==""){
        opencpu$start();
    }else{
        opencpu$start(port);
    }
    # visualize
    opencpu$browse(paste0("/library/",pkg,"/www/",page));
}

その後、次のことができます。

testApp()

テストしindex.htmlたり

testApp("mypage.html") 

特定のページをテストします。

于 2015-08-10T09:16:03.430 に答える