Learning R: Writing Functions & More

  • Context: High School 
  • Thread starter Thread starter Tereno
  • Start date Start date
  • Tags Tags
    Functions Writing
Click For Summary

Discussion Overview

The discussion centers around using the R programming language to write functions, particularly focusing on string manipulation and evaluation of character counts within a given string. Participants seek assistance with specific coding challenges and clarifications on using R effectively.

Discussion Character

  • Exploratory
  • Technical explanation
  • Homework-related

Main Points Raised

  • One participant inquires about writing functions in R, specifically for counting characters in a string.
  • Another participant suggests consulting the R manual for guidance.
  • A participant expresses difficulty in understanding the manual and seeks further clarification.
  • A specific example is provided where a participant wants to evaluate the number of occurrences of 'A' or 'T' and sum them differently from 'G' and 'C' in a given string.
  • The participant mentions challenges with using conditional statements like if-else for their task.

Areas of Agreement / Disagreement

Participants do not appear to reach a consensus on the best approach to writing functions in R or resolving the specific coding challenge presented. Multiple viewpoints and suggestions are offered without a definitive solution.

Contextual Notes

Some participants indicate uncertainty regarding the clarity of the R manual and the specific requirements for the coding task, which may affect their ability to provide effective assistance.

Who May Find This Useful

Individuals learning R programming, particularly those interested in string manipulation and function writing, may find this discussion relevant.

Tereno
Messages
8
Reaction score
0
Does anyone know how to use the R language to write functions and etc?
 
Physics news on Phys.org
Yeah I kinda did..and not to clear about it.
 
R programmation

Does anyone know how to use the R language to write functions for string?

I have this type of string:

ATGTTGCGTGTC

I want to evalute the number of A or T and G and C for every A/T a want to sum 2 for the other 4 I want to have one number...
did you have any suggestion? because with If else I have difficultis
Thanks for any help
 

Similar threads

  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 15 ·
Replies
15
Views
6K
  • · Replies 4 ·
Replies
4
Views
1K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 8 ·
Replies
8
Views
5K