forked from ricds/DL_RS_GEE
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.Rhistory
82 lines (82 loc) · 2.25 KB
/
.Rhistory
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# restart and run this and it worked
library(pacman)
p_load(rgee, geojsonio, remotes, reticulate, devtools)
# install general packages used in the scripts
p_load(raster,
rgdal,
rgeos,
gdalUtils,
sp,
sf,
leaflet,
mapview,
caret)
library(pacman)
# install general packages used in the scripts
p_load(raster,
rgdal,
rgeos,
gdalUtils,
sp,
sf,
leaflet,
mapview,
caret)
# restart and run this and it worked
p_load(rgee, geojsonio, remotes, reticulate, devtools)
install_github("r-spatial/rgee")
rgee_environment_dir
## copy the path to the rgee_py environment, you will need it set in the variable below inside R:
## note the use of double backslashes \\
## this below is where is located in MY computer, you have to use the 'conda env list' command to find where it is located on yours
rgee_environment_dir = "C:\\ProgramData\\Miniconda3\\envs\\rgee_py\\"
# set python
reticulate::use_python(rgee_environment_dir, required=T)
rgee::ee_install_set_pyenv(
py_path = rgee_environment_dir, # Change it for your own Python PATH
py_env = "rgee_py" # Change it for your own Python ENV
)
Sys.setenv(RETICULATE_PYTHON = rgee_environment_dir)
Sys.setenv(EARTHENGINE_PYTHON = rgee_environment_dir)
# 1. Initialize the Python Environment
# to clean credentials: ee_clean_credentials()
rgee::ee_Initialize(drive = T)
rgee_environment_dir = "C:\\ProgramData\\Miniconda3\\envs\\rgee_py\\"
# install general packages used in the scripts
p_load(raster,
rgdal,
rgeos,
gdalUtils,
sp,
sf,
leaflet,
mapview,
caret)
p_load(rgee, geojsonio, remotes, reticulate, devtools)
# install general packages used in the scripts
p_load(raster,
rgdal,
rgeos,
gdalUtils,
sp,
sf,
leaflet,
mapview,
caret)
# restart and run this and it worked
p_load(rgee, geojsonio, remotes, reticulate, devtools)
install_github("r-spatial/rgee")
rgee_environment_dir
# set python
reticulate::use_python(rgee_environment_dir, required=T)
rgee::ee_install_set_pyenv(
py_path = rgee_environment_dir, # Change it for your own Python PATH
py_env = "rgee_py" # Change it for your own Python ENV
)
Sys.setenv(RETICULATE_PYTHON = rgee_environment_dir)
Sys.setenv(EARTHENGINE_PYTHON = rgee_environment_dir)
# Initialize the Python Environment
# to clean credentials: ee_clean_credentials()
rgee::ee_Initialize(drive = T)
ee_clean_credentials()
rgee::ee_Initialize(drive = T)