{"id":50108928,"url":"https://github.com/akhi07rx/petals-using-r","last_synced_at":"2026-05-23T12:04:12.842Z","repository":{"id":210786520,"uuid":"727353404","full_name":"akhi07rx/Petals-Using-R","owner":"akhi07rx","description":"This R code generates a plot of a flower. It uses polar coordinates and the sine function to create the petal shapes and then plots them.","archived":false,"fork":false,"pushed_at":"2023-12-05T17:23:38.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-01-25T00:11:38.159Z","etag":null,"topics":["data-visualization","graphics","opensource","plot","r","trignometry"],"latest_commit_sha":null,"homepage":"https://www.mycompiler.io/view/LlEFN1GFbZ6","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/akhi07rx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-12-04T17:38:24.000Z","updated_at":"2024-01-20T16:04:19.000Z","dependencies_parsed_at":"2023-12-19T01:00:21.500Z","dependency_job_id":null,"html_url":"https://github.com/akhi07rx/Petals-Using-R","commit_stats":{"total_commits":12,"total_committers":1,"mean_commits":12.0,"dds":0.0,"last_synced_commit":"c5a9dfad83c45caee7d7c1ff0b20c38d9798035d"},"previous_names":["akhi07rx/petals-using-r"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/akhi07rx/Petals-Using-R","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akhi07rx%2FPetals-Using-R","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akhi07rx%2FPetals-Using-R/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akhi07rx%2FPetals-Using-R/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akhi07rx%2FPetals-Using-R/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akhi07rx","download_url":"https://codeload.github.com/akhi07rx/Petals-Using-R/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akhi07rx%2FPetals-Using-R/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33394677,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-23T04:15:53.637Z","status":"ssl_error","status_checked_at":"2026-05-23T04:15:53.242Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-visualization","graphics","opensource","plot","r","trignometry"],"created_at":"2026-05-23T12:03:47.569Z","updated_at":"2026-05-23T12:04:12.836Z","avatar_url":"https://github.com/akhi07rx.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Petals-Using-R\n\nThis repository contains a simple R script that generates a plot of a flower with a specified number of petals. The plot is created using the base graphics system in R.\n\n## Screenshots\n\n![image](https://i.imgur.com/zUn5eRh.png)\n\n## Code Overview\n\nThe code uses basic trigonometric functions to generate the coordinates of the points on the petals of a flower. The number of petals is determined by the variable `n_petals`.\n\n```R\nn_petals \u003c- 16\ntheta \u003c- seq(0, 2*pi, length.out = 1000)\n\nradius \u003c- sin(n_petals * theta)\n\nx \u003c- radius * cos(theta)\ny \u003c- radius * sin(theta)\n\nplot(x, y, type = \"l\", xlab = \"X\", ylab = \"Y\", main = \"Petals in R\")\n```\n\n- `n_petals` is the number of petals you want your flower to have.\n- `theta` is a sequence of numbers from 0 to 2π, which represents the angle in polar coordinates.\n- `radius` is calculated as the sine of the product of `n_petals` and `theta`. This is what creates the petal shapes.\n- `x` and `y` are the Cartesian coordinates, calculated from the `radius` and `theta`.\n- The `plot` function is then used to create a line plot of `x` and `y`, which results in a flower shape.\n\n## Running the Code\n\nYou can run this code online at [https://www.mycompiler.io/view/LlEFN1GFbZ6].\n\n## Contributing\n\nContributions are welcome! If you have a feature request, bug report, or want to improve the code, please feel free to open an issue or submit a pull request.\n\n## License\n\nThis project is licensed under the MIT License.\nPlease see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakhi07rx%2Fpetals-using-r","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakhi07rx%2Fpetals-using-r","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakhi07rx%2Fpetals-using-r/lists"}