Skip to content

Commit fc88b6d

Browse files
committed
2 parents d49c0e2 + 7f614f7 commit fc88b6d

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
# More Examples with antaresRead, R and data.table
22

33
You can find more examples about antaresRead [here](http://htmlpreview.github.io/?https://github.com/rte-antares-rpackage/antaresME/blob/master/antaresReadME.html)
4+
5+
## Why more examples ?
6+
7+
Antares packages use R and data.table, sometimes users learn in the same time how to use R, data.table and Antares packages. We cannot write R or data.table examples in Antares packages because it's not the good place and it will be soon examples in desorder.

antaresReadME.Rmd

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ names(myData$areas)
162162
names(myData$links)
163163
```
164164

165-
## How can I edit an existing column in an antaresData or in an data.table ?
165+
## How can I edit an existing column in an antaresData or in a data.table ?
166166

167167
Import your data
168168

antaresReadME.html

+6-6
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ <h4 class="date"><em>22 mars 2018</em></h4>
131131
<li><a href="#how-to-write-some-variables-in-a-csv-file"><span class="toc-section-number">1.2</span> How to write some variables in a csv file ?</a></li>
132132
<li><a href="#how-can-i-know-the-type-and-class-of-my-antares-object"><span class="toc-section-number">1.3</span> How can I know the type and class of my ANTARES object ?</a></li>
133133
<li><a href="#how-can-i-get-the-names-of-the-columns"><span class="toc-section-number">1.4</span> How can I get the names of the columns ?</a></li>
134-
<li><a href="#how-can-i-edit-an-existing-column-in-an-antaresdata-or-in-an-data.table"><span class="toc-section-number">1.5</span> How can I edit an existing column in an antaresData or in an data.table ?</a></li>
134+
<li><a href="#how-can-i-edit-an-existing-column-in-an-antaresdata-or-in-a-data.table"><span class="toc-section-number">1.5</span> How can I edit an existing column in an antaresData or in a data.table ?</a></li>
135135
<li><a href="#how-can-i-add-a-new-column-in-an-antaresdata-or-in-a-data.table"><span class="toc-section-number">1.6</span> How can I add a new column in an antaresData or in a data.table ?</a></li>
136136
</ul></li>
137137
<li><a href="#links"><span class="toc-section-number">2</span> Links</a><ul>
@@ -232,8 +232,8 @@ <h2><span class="header-section-number">1.4</span> How can I get the names of th
232232
## [5] &quot;month&quot; &quot;hour&quot; &quot;FLOW LIN.&quot; &quot;CONG. PROB +&quot;
233233
## [9] &quot;CONG. PROB -&quot;</code></pre>
234234
</div>
235-
<div id="how-can-i-edit-an-existing-column-in-an-antaresdata-or-in-an-data.table" class="section level2">
236-
<h2><span class="header-section-number">1.5</span> How can I edit an existing column in an antaresData or in an data.table ?</h2>
235+
<div id="how-can-i-edit-an-existing-column-in-an-antaresdata-or-in-a-data.table" class="section level2">
236+
<h2><span class="header-section-number">1.5</span> How can I edit an existing column in an antaresData or in a data.table ?</h2>
237237
<p>Import your data</p>
238238
<pre class="r"><code>library(antaresRead)
239239
#pathStudy : path to my study
@@ -298,10 +298,10 @@ <h2><span class="header-section-number">1.5</span> How can I edit an existing co
298298
## 17: NA NA
299299
## 18: NA NA</code></pre>
300300
<p>Edit an existing column</p>
301-
<pre class="r"><code>#When co2 is na, replace the value by 0
302-
dim(myData[is.na(co2), ])[1]</code></pre>
301+
<pre class="r"><code>dim(myData[is.na(co2), ])[1]</code></pre>
303302
<pre><code>## [1] 4</code></pre>
304-
<pre class="r"><code>myData[is.na(co2), co2:=0]
303+
<pre class="r"><code>#When co2 is na, replace the value by 0
304+
myData[is.na(co2), co2:=0]
305305

306306
dim(myData[is.na(co2), ])[1]==0</code></pre>
307307
<pre><code>## [1] TRUE</code></pre>

0 commit comments

Comments
 (0)