代写PLS 021 Spring 2025 Homework 6代写数据结构语言

PLS 021 Spring 2025

Homework 6

Rstudio Part 2

Instructions

This homework is due four (4) days after your registered lab section before 11:55 pm. Please read and follow the directions.  If you have any questions, contact your TA or attend office hours.

Assignment Overview

For this assignment, you will be presented with several scenarios requiring computational solutions.  You are expected to use RStudio software to develop and run your R code to derive the necessary answers. Your submission should consist of a single R script file containing your solutions.  Ensure that you follow the submission instructions provided at the end of this homework to receive full points.

Note: The use of Artificial Intelligence tools for generating code is strictly prohibited. You are required to solve the tasks independently, following the instructions provided during class.

Task 1: Thermal profile of water in Lake Berryessa

Solar radiation heats water bodies on the Earth’s surface, though not all of the energy is absorbed by the water. Approximately 6-7% of the incoming radiation is reflected back due to the water’s albedo.  In pure water, nearly 70% of solar radiation is absorbed within the top 5 meters of the water’s depth.  The penetration depth of solar radiation can vary depending on the clarity of the water, leading to variations in water temperature with increasing depth, particularly during the summer months.  Marvin E. Jensen measured water temperature at various depths in Lake Berryessa during July 2003 and observed the same phenomenon. The resulting dataset was used to correlate ‘Depth’ and ‘Temperature’ using a simple sigmoidal curve fit. The equation is:

Your task is to help visualize the temperature of water at different depths of the water based on the instructions provided below.

1.  Create a variable named Depths that contains values ranging from 5 to 25 incre- menting by a value of 5.  (1 pt.)

2.  Use for-loop to iterate among the different depth values in Depths  and calculate Temperature for each values of Depths using the equation provided above and print them. Store the printed values in a single variable called WaterTemp.(2 pt.)

3.  Create a scatter plot with  WaterTemp in y axis and Depths in x axis.  (1 pt.)

Task 2: Identifying odd and even digits in your Stu- dent ID

For this task, you will identify the odd and even digits in your Student ID. Note that “0” should be considered an even number. Follow the instructions provided below:

1.  Create a variable MyID by concatenating the numerical digits from your Student ID. Make sure to use your actual SIS Student ID. Hint:  if your student ID is 919198498, you will need to concatenate 9, 1, 9, 1, 9, 8, 4, 9, and 8.  (1 pt.)

2. Use a for-loop  to  iterate through the digits in  MyID.  For each iteration,  print whether the numerical digit is odd or even.  (2 pt.)

Share your R code along with the results, and include an explanation of how you personalized  the  input  values  by  adding  comments.    Ensure  that  your  code  is  well- documented, with comments that clarify your choice of input values and explain each step of your solution.

Task 3: Calculating investment pay-back period

You recently decided to help your family install solar panels on the roof of your home. The total cost of the solar panels was $X  (replace X with a value you choose).  Each year, your family saves $Y on electricity bills because of the solar panels (replace Y with a value you choose).

Write an R program using a ‘while’ loop to calculate how many years it will take for your family to recover the entire initial investment through the annual savings based on the instructions provided below-

1. The value for X (total cost) and Y (annual savings) depends on your birth month and day.

X = 10, 000 + (month × 1000)

Y = 500 + (day × 10)

For example: If your birthday is April 15th, you might choose X = 10, 000 + (4 × 1000) and Y = 500+(15 × 10).  If your birthday is December 3rd, you might choose X = 12, 000 + (12 × 1000) and Y = 600 + (3 × 20).

2. Write the full equation that you have used to calculate the value of X and Y in you Rscript.  Make sure to adjust your values for X and Y so they reflect a realistic scenario. Put your actual birthday (month and day number) that you have used to calculate value of X and Y as comment.  (1 pt.)

3. Implement the solution using a ‘while’ loop to determine the number of years re- quired to recover the initial investment. (2 pt.)

Share your R code along with the results, and include an explanation of how you personalized  the  input  values  by  adding  comments.    Ensure  that  your  code  is  well- documented, with comments that clarify your choice of input values and explain each step of your solution.

Instructions for Submitting Coding Tasks

1.  Complete all three coding tasks using the desktop version of RStduio software.

2.  Ensure that each task is clearly separated within the same R script file.  You can do this by adding comments to label each task. Use the format below:

# Task 1:

# (Your code for Task 1 here)

# Task 2:

# (Your code for Task 2 here)

# Task 3:

# (Your code for Task 3 here)

3.  Save all tasks in a single R script file named Section LastName FirstName HW6 . R (e.g., A01 Bailey Brian HW6. R).

4.  Upload your R script file to Canvas, which should include the necessary code for all the above-mentioned tasks.

5. Important:  Do not upload any other type of file except for an R script file with the  . R extension.  Failure to follow this instruction will result in 0 points for this homework.

Note: Ensure that the code is properly formatted and commented so that each task is easy to identify and review.


热门主题

课程名

mktg2509 csci 2600 38170 lng302 csse3010 phas3226 77938 arch1162 engn4536/engn6536 acx5903 comp151101 phl245 cse12 comp9312 stat3016/6016 phas0038 comp2140 6qqmb312 xjco3011 rest0005 ematm0051 5qqmn219 lubs5062m eee8155 cege0100 eap033 artd1109 mat246 etc3430 ecmm462 mis102 inft6800 ddes9903 comp6521 comp9517 comp3331/9331 comp4337 comp6008 comp9414 bu.231.790.81 man00150m csb352h math1041 eengm4100 isys1002 08 6057cem mktg3504 mthm036 mtrx1701 mth3241 eeee3086 cmp-7038b cmp-7000a ints4010 econ2151 infs5710 fins5516 fin3309 fins5510 gsoe9340 math2007 math2036 soee5010 mark3088 infs3605 elec9714 comp2271 ma214 comp2211 infs3604 600426 sit254 acct3091 bbt405 msin0116 com107/com113 mark5826 sit120 comp9021 eco2101 eeen40700 cs253 ece3114 ecmm447 chns3000 math377 itd102 comp9444 comp(2041|9044) econ0060 econ7230 mgt001371 ecs-323 cs6250 mgdi60012 mdia2012 comm221001 comm5000 ma1008 engl642 econ241 com333 math367 mis201 nbs-7041x meek16104 econ2003 comm1190 mbas902 comp-1027 dpst1091 comp7315 eppd1033 m06 ee3025 msci231 bb113/bbs1063 fc709 comp3425 comp9417 econ42915 cb9101 math1102e chme0017 fc307 mkt60104 5522usst litr1-uc6201.200 ee1102 cosc2803 math39512 omp9727 int2067/int5051 bsb151 mgt253 fc021 babs2202 mis2002s phya21 18-213 cege0012 mdia1002 math38032 mech5125 07 cisc102 mgx3110 cs240 11175 fin3020s eco3420 ictten622 comp9727 cpt111 de114102d mgm320h5s bafi1019 math21112 efim20036 mn-3503 fins5568 110.807 bcpm000028 info6030 bma0092 bcpm0054 math20212 ce335 cs365 cenv6141 ftec5580 math2010 ec3450 comm1170 ecmt1010 csci-ua.0480-003 econ12-200 ib3960 ectb60h3f cs247—assignment tk3163 ics3u ib3j80 comp20008 comp9334 eppd1063 acct2343 cct109 isys1055/3412 math350-real math2014 eec180 stat141b econ2101 msinm014/msing014/msing014b fit2004 comp643 bu1002 cm2030
联系我们
EMail: 99515681@qq.com
QQ: 99515681
留学生作业帮-留学生的知心伴侣!
工作时间:08:00-21:00
python代写
微信客服:codinghelp
站长地图