Run any R code from the box below or use this general-purpose interface
-
- Active Topics
-
-
- by Eli 1 day ago All in One: YouTube, TED, X, Facebook and Instagram Reels, Videos, Images and Text Posts View the latest post Replies 332 Views 40530
- by Eli 1 day ago Iran's President Ebrahim Raisi Aged 63 Dies in a Helicopter Crash View the latest post Replies 3 Views 63
- by Eli 1 day ago Re: What is in Your Mind? View the latest post Replies 717 Views 307295
- by Eli 3 days ago PySpark for Large Data Processing View the latest post Replies 2 Views 8172
- by Eli 3 days ago Online Bible View the latest post Replies 3 Views 23331
- by Eli 3 days ago Generating SSH Key and Adding it to the ssh-agent for Authentication on GitHub View the latest post Replies 1 Views 489
- by Eli 1 week ago Russia Invades Ukraine View the latest post Replies 663 Views 241135
- by Eli 2 weeks ago President Museveni's Speech During International Development Association (IDA) Summit View the latest post Replies 1 Views 509
- by Eli 2 weeks ago From Simple Linear Regression Analysis to Covariance & Correlation to Independent Determinant, and R-Squared View the latest post Replies 11 Views 25145
- by Eli 2 weeks ago Collection of Greatest Christian Hymns of all Times View the latest post Replies 34 Views 72670
-
Run any R Code Directly From This Forum
- Eli
- Senior Expert Member
- Reactions: 183
- Posts: 5410
- Joined: 9 years ago
- Location: Tanzania
- Has thanked: 75 times
- Been thanked: 88 times
- Contact:
Test this R code, see here.
- # Define parameters and initial conditions
- a <- -8/3; b <- -10; c <- 28
- #Create a three-valued vector of initial conditions using c function
- yini <- c(X = 1, Y = 1, Z = 1)
- Lorenz <- function(t, y, parms){with (as.list(y), {dX <- a*X + Y*Z; dY <- b*(Y - Z); dZ <- -X*Y + c*Y - Z;
- list(c(dX, dY, dZ))})}
- library(deSolve)
- # We solve the IVP for 100 days producing the output after every 0.01 days
- times <- seq(from = 0, to = 100, by = 0.01)
- #Integrate
- out <- ode(y = yini, times = times, func = Lorenz, parms = NULL)
- # We check the output by printing out the first five lines
- head(out, n = 5)
- plot(out, lwd = 2)
- # Plot variables Y versus X to generate the famous butterfly
- plot(out[,"X"], out[,"Y"], type = "l", xlab = "X", ylab = "Y", main = "Butterfly")
0
TSSFL -- A Creative Journey Towards Infinite Possibilities!
-
- Expert Member
- Reactions: 23
- Posts: 55
- Joined: 7 years ago
- Has thanked: 14 times
- Been thanked: 28 times
- Contact:
My laptop is dead, the only option is to use this platform at the moment for R analysis. @Eli, is it possible to add csv and port them in this editor?
- Eli
- Senior Expert Member
- Reactions: 183
- Posts: 5410
- Joined: 9 years ago
- Location: Tanzania
- Has thanked: 75 times
- Been thanked: 88 times
- Contact:
Yes, you can use read.csv both here and using SageMath engine.
For example,
will give you:
For example,
- df <- read.csv("https://github.com/selva86/datasets/raw/master/mtcars.csv")
- head(df)
will give you:
- mpg cyl disp hp drat wt qsec vs am gear carb fast cars
- 1 4.582576 6 160 110 3.90 2.620 16.46 0 1 4 4 1 Mazda RX4
- 2 4.582576 6 160 110 3.90 2.875 17.02 0 1 4 4 1 Mazda RX4 Wag
- 3 4.774935 4 108 93 3.85 2.320 18.61 1 1 4 1 1 Datsun 710
- 4 4.626013 6 258 110 3.08 3.215 19.44 1 0 3 1 1 Hornet 4 Drive
- 5 4.324350 8 360 175 3.15 3.440 17.02 0 0 3 2 1 Hornet Sportabout
- 6 4.254409 6 225 105 2.76 3.460 20.22 1 0 3 1 1 Valiant
- carname
- 1 Mazda RX4
- 2 Mazda RX4 Wag
- 3 Datsun 710
- 4 Hornet 4 Drive
- 5 Hornet Sportabout
- 6 Valiant
0
TSSFL -- A Creative Journey Towards Infinite Possibilities!
- Eli
- Senior Expert Member
- Reactions: 183
- Posts: 5410
- Joined: 9 years ago
- Location: Tanzania
- Has thanked: 75 times
- Been thanked: 88 times
- Contact:
Try:
Plot output
- #Let's explore the iris Data with R
- #Load required libraries
- library(datasets)
- data(iris)
- summary(iris)
- plot(iris)
Plot output
- Attachments
-
- iris.png (33.25 KiB) Viewed 27425 times
- iris.png (33.25 KiB) Viewed 27425 times
0
TSSFL -- A Creative Journey Towards Infinite Possibilities!
- Eli
- Senior Expert Member
- Reactions: 183
- Posts: 5410
- Joined: 9 years ago
- Location: Tanzania
- Has thanked: 75 times
- Been thanked: 88 times
- Contact:
What is the output ?
- my_print = function(ABCD){
- print("MY NAME")
- }
- my_print()
- my_print = function(a){
- print(paste("MY NAME IS",a))
- }
- my_print("John")
0
TSSFL -- A Creative Journey Towards Infinite Possibilities!
-
- Similar Topics
- Replies
- Views
- Last post
-
- Information
-
Who is online
Users browsing this forum: No registered users and 0 guests