0% found this document useful (0 votes)
20 views2 pages

R Programming Practice Questions-1

The document contains a comprehensive set of R programming practice questions divided into seven sections, covering basic programming, data import/export, data manipulation with dplyr, data visualization, statistical analysis, package management, and applied medical imaging scenarios. Each section includes 10 questions that test knowledge and skills relevant to R programming and data analysis. The questions range from basic syntax and functions to more advanced data manipulation and visualization techniques.

Uploaded by

robertmiller2822
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views2 pages

R Programming Practice Questions-1

The document contains a comprehensive set of R programming practice questions divided into seven sections, covering basic programming, data import/export, data manipulation with dplyr, data visualization, statistical analysis, package management, and applied medical imaging scenarios. Each section includes 10 questions that test knowledge and skills relevant to R programming and data analysis. The questions range from basic syntax and functions to more advanced data manipulation and visualization techniques.

Uploaded by

robertmiller2822
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

R Programming Practice Questions

Section A: Basic R Programming (Questions 1-10)


1. How do you correctly assign a numeric value in R?
2. Which function determines the data type of a variable in R?
3. How would you create a vector containing scan durations: 15, 20, 35, 45 minutes?
4. How do you create a logical variable correctly?
5. How do you access the fourth element of a vector named modality_types?
6. What type of object does c("Ultrasound", "MRI", "PET") create?
7. Which function is used to create a data frame in R?
8. How do you access a column called "dose" in a data frame named "procedures"?
9. What does length(c(2, 4, 6, 8, 10, 12)) return?
10. How do you create a character variable?
Section B: Data Import/Export (Questions 11-20)
11. Which function reads CSV files into R?
12. What does the tail() function do?
13. To work with Excel files, which package is required?
14. Which function displays the structure of a dataset?
15. To export a data frame to CSV format, which function do you use?
16. What information does the summary() function provide?
17. To ignore the first 3 rows when reading a CSV file, what parameter would you use?
18. Which parameter excludes row names when writing a CSV file?
19. What is the read_excel() function used for?
20. To display the first 8 rows of your data, which function would you use?
Section C: Data Manipulation with dplyr (Questions 21-30)
21. In dplyr, which function selects specific columns?
22. Which dplyr function filters rows based on criteria?
23. What is the purpose of the pipe operator %>%?
24. Which function adds new columns in dplyr?
25. To sort data by dose in descending order using dplyr, which function do you use?
26. What is the purpose of group_by() in dplyr?
27. Which function computes summary statistics in dplyr?
28. To count observations in each category, which functions can you use?
29. What does ifelse(dose > 100, "High", "Normal") create?
30. To rename a column from "patient_id" to "id" in dplyr, how do you do it?
Section D: Data Visualization (Questions 31-40)
31. Which package is most commonly used for advanced plotting in R?
32. In ggplot2, what does aes() define?
33. Which geom creates a scatter plot in ggplot2?
34. To create a histogram in ggplot2, which geom do you use?
35. What does geom_violin() create?
36. In base R, which function creates a histogram?
37. To add a subtitle to a ggplot, how do you do it?
38. Which function creates a violin plot in ggplot2?
39. To modify colors in ggplot2, what options do you have?
40. What does facet_grid() do in ggplot2?
Section E: Statistical Analysis (Questions 41-50)
41. Which function calculates the arithmetic mean?
42. What does var() calculate?
43. Which function performs a t-test?
44. What does the cor() function measure?
45. To perform ANOVA, which functions would you use?
46. Which function finds the middle value?
47. What does the IQR() function return?
48. To fit a linear model, which function do you use?
49. Which function calculates the total of values?
50. What does xtabs() create?
Section F: Package Management (Questions 51-60)
51. How do you install an R package?
52. How do you load a package in R?
53. Which package is essential for data manipulation?
54. Which package is designed for data visualization?
55. To handle Excel files, which packages are useful?
56. What information does sessionInfo() display?
57. Which package contains select() and mutate() functions?
58. To list installed packages, which function can you use?
59. What does the tidyverse refer to?
60. Which commands show function documentation?
Section G: Applied Medical Imaging Scenarios (Questions 61-70)
61. To calculate the mean radiation exposure from your dose measurements, which
function would you use?
62. To visualize the distribution of examination duration times, which plot is most suitable?
63. To compare radiation doses across different imaging protocols, which visualization is
best?
64. To filter your dataset for pediatric patients (age < 18), how do you do it?
65. To count examinations by imaging modality, which functions would you use?
66. To create a variable indicating high-dose procedures (dose > 50 mGy), how do you do
it?
67. To import imaging data from "imaging_data.xlsx", which function would you use?
68. To export your analysis to "dose_analysis.csv", which function would you use?
69. To test if there's a significant difference in scan times between two scanner models,
which test is appropriate?
70. To show trends in monthly examination volumes over time, which plot type is most
effective?

You might also like