Sign in with Microsoft
Sign in or create an account.
Hello,
Select a different account.
You have multiple accounts
Choose the account you want to sign in with.

問題

已執行批次中很有用或其他最佳作法是 R 工作的開頭是 rm(list=ls())?

回應

是,它可關閉您的批次指令碼,只是為了確定您在提交批次工作之前有乾淨的 R 環境命令 'rm(list=ls())' 與開始。例如,您可能有其自身的使用者。Rprofile 檔案的一系列中建立一些 R 物件的 r 啟動的指令在此情況下可能很有用,來清除任何現有的 R 物件之前執行批次工作的 R 程式碼。

例如,以下是虛擬程式碼來執行這項操作︰

x <-ls()
如果 (x 不是空白) {
rm(list=ls()
}

是,您當然可以執行如下的程式碼,在使用者工作區中移除現有的 「 R 」 物件的啟動之後。

Need more help?

Want more options?

探索訂閱權益、瀏覽訓練課程、瞭解如何保護您的裝置等等。

社群可協助您詢問並回答問題、提供意見反應,以及聆聽來自具有豐富知識的專家意見。

Was this information helpful?

How satisfied are you with the translation quality?
What affected your experience?
By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.

Thank you for your feedback!

×