Skip to content

Commit 48a7393

Browse files
committed
fix 25
1 parent a0ea262 commit 48a7393

1 file changed

Lines changed: 2 additions & 46 deletions

File tree

docs/08-r-help.md

Lines changed: 2 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -169,57 +169,13 @@ script.
169169
[1] tools_3.2.3 packrat_0.4.9-1
170170
```
171171

172-
Many times, there may be some issues with your data and the way it is
173-
formatted. In that case, you may want to share that data with someone
174-
else. However, you may not need to share the whole dataset; looking at a
175-
subset of your 50,000 row, 10,000 column data frame may be TMI (too much
176-
information)! You can take an object you have in memory such as a
177-
data frame and save it to a file. In our example we will use the `dput()`
178-
function on the `iris` data frame which is an example dataset that is installed
179-
in R:
180172

181-
!!! r-project "r"
182-
183-
```r
184-
dput(head(iris))
185-
186-
# iris is an example data.frame that comes with R
187-
# the `head()` function just takes the first 6 lines of the iris dataset
188-
```
189-
190-
This generates some output (below) which you will be better able to
191-
interpret after covering the other R lessons. This info would be helpful
192-
in understanding how the data is formatted and possibly revealing
193-
problematic issues.
194-
195-
!!! success "Output"
196-
197-
```
198-
structure(list(Sepal.Length = c(5.1, 4.9, 4.7, 4.6, 5, 5.4),
199-
Sepal.Width = c(3.5, 3, 3.2, 3.1, 3.6, 3.9), Petal.Length = c(1.4,
200-
1.4, 1.3, 1.5, 1.4, 1.7), Petal.Width = c(0.2, 0.2, 0.2,
201-
0.2, 0.2, 0.4), Species = structure(c(1L, 1L, 1L, 1L, 1L,
202-
1L), levels = c("setosa", "versicolor", "virginica"), class = "factor")), row.names = c(NA,
203-
6L), class = "data.frame")
204-
```
205-
206-
Alternatively, you can also save objects in R memory to a file by
207-
specifying the name of the object, in this case the `iris` data frame,
208-
and passing a filename to the `file=` argument.
209-
210-
!!! r-project "r"
211-
212-
```r
213-
saveRDS(iris, file="iris.rds")
214-
215-
# By convention, we use the .rds file extension
216-
```
217173

218174

219175
## Using AI
220176

221-
AI tools such as ChatGPT can be very useful for getting help with R
222-
programming. The best way to learn how to use these tools is to play around with them. Try asking how to make a nice boxplot in R using your favourite colours, how to import a csv table from your local computer into RStudio, or how to calculate summary statistics for a dataframe in R. You can also ask for help with specific error messages you encounter while coding in R.
177+
AI tools such as ChatGPT and Claude can be very useful for getting help with R
178+
programming. The best way to learn how to use these tools is to play around with them. Try asking how to make a nice boxplot in R using your favourite colours, how to import a csv table from your local computer into RStudio, or how to calculate summary statistics for a dataframe in R. You can also ask for help with specific error messages you encounter while coding in R.
223179

224180
> Note: Be cautious and always verify the information provided by AI, as it may not always be accurate or reliable. Use AI as a starting point, but don't rely on it exclusively for critical tasks. Be very cautious about sharing sensitive or personal information with AI tools.
225181

0 commit comments

Comments
 (0)