0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ディレクトリの移動

Posted at

ディレクトリ移動の練習

はじめに,今のディレクトリを表示してみる.

> getwd()
[1] "/Users/user-name"

つぎに,デスクトップの"Visualization"ディレクトリに移動してみる.

> setwd('/Users/user-name/Desktop/Visualization/')
> getwd()
[1] "/Users/user-name/Desktop/Visualization"

これは,絶対パスで移動した場合で,すでにDesktopにいる場合は,相対パスで指定して

> setwd('Visualization')
> getwd()
[1] "/Users/user-name/Desktop/Visualization"

で移動できる.また,

> setwd('./Visualization')
> getwd()
[1] "/Users/user-name/Desktop/Visualization"

という書き方もある.

ちなみに,一つ上の階層に上がる(相対パス)ときは,

> setwd('..')
> getwd()
[1] "/Users/user-name/Desktop"

となる.

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?