Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6925121
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:44:56+00:00 2026-05-27T10:44:56+00:00

This is a reproducible example: a <- 0.05 za.2 <- qnorm(1-a/2) b <- 0.20

  • 0

This is a reproducible example:

a <- 0.05
za.2 <- qnorm(1-a/2)
b <- 0.20
zb <- qnorm(1-b)

lambda12 <- -log(1/2)/12
lambda18 <- -log(1/2)/18
theta <- lambda18/lambda12
(d = round(4*(za.2+zb)^2/log(theta)^2))   

Tf<-36
library(Ryacas)
n <- Sym("n")

Solve(n/2*(2-exp(-lambda12*Tf)-exp(-lambda18*Tf))==d , n)

The last line returns

expression(list(n == 382/1.625))

Is there a way to extract the quotient and assign it to another variable (235.0769)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T10:44:57+00:00Added an answer on May 27, 2026 at 10:44 am

    G.Grothendieck pointed out in comments that you’ll need to first to capture the expression to be operated upon below:

    soln <- Solve(n/2*(2-exp(-lambda12*Tf)-exp(-lambda18*Tf))==d , n) 
    X <- yacas(soln)$text
    

    Then, to extract the quotient, you can take advantage of the fact that many R language objects either are or can be coerced to lists.

     X <- expression(list(n == 382/1.625))
     res <- eval(X[[1]][[2]][[3]])
     res
     [1] 235.0769
    

    The following just shows why that sequence of indices extracts the right piece of the expression:

    as.list(X)
    # [[1]]
    # list(n == 382/1.625)
    
    as.list(X[[1]])
    # [[1]]
    # list
    # 
    # [[2]]
    # n == 382/1.625
    
    as.list(X[[1]][[2]])
    # [[1]]
    # `==`
    # 
    # [[2]]
    # n
    # 
    # [[3]]
    # 382/1.625
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This problem is not readily reproducible in a simple example here but was wondering
please consider this reproducible example: from PIL import Image import numpy as np import
To provide a reproducible example of an approach, a data set must often be
EDIT : This reproducible SIGSEGV happens on a Linux machine with more than one
The only available reproducible example I can find to share with the board is
I started making a reproducible example to ask another question and can't even get
this is my first question in here, and I would like to ask if
This question is directly related to this SO question I posed about 15 minutes
This question is kind of a follow up to this question I asked a
This should be a simple one: I have an observableArray object called To in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.