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 7750669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:21:02+00:00 2026-06-01T11:21:02+00:00

For some packages I can see special type of objects. For example I am

  • 0

For some packages I can see special type of objects. For example I am getting following message when I try to print a dataset from a package.

multitrait

This is an object of class "cross".
  It is too complex to print, so we provide just this summary.
    RI strains via selfing

    No. individuals:    162

......................and other summary information

is (multitrait)

 [1] "riself"

I wonder how we can created such object. Are they special lists of dataframe, matrix of vector.

X <- c("A", "B", "C")
Y <- data.frame (A = 1:10, B = 21:30, C = 31:40)
myeq <- c("Y ~ X1 + Y1")
K <- 100
A = 1:20
B = B= 21:40
J <- as.matrix(A,B )
myl1 <- list(J, K)

Now my complex object:

mycomplexobject <- list(X, Y, myeq, K, J, myl1) 
mycomplexobject
str(mycomplexobject)

List of 6
 $ : chr [1:3] "A" "B" "C"
 $ :'data.frame':       10 obs. of  3 variables:
  ..$ A: int [1:10] 1 2 3 4 5 6 7 8 9 10
  ..$ B: int [1:10] 21 22 23 24 25 26 27 28 29 30
  ..$ C: int [1:10] 31 32 33 34 35 36 37 38 39 40
 $ : chr "Y ~ X1 + Y1"
 $ : num 100
 $ : int [1:20, 1] 1 2 3 4 5 6 7 8 9 10 ...
 $ :List of 2
  ..$ : int [1:20, 1] 1 2 3 4 5 6 7 8 9 10 ...
  ..$ : num 100

is(mycomplexobject)

 [1] "list"   "vector"

Is there way to make special object and prevent printing whole list instead message like “it is complex to print” and provide summary instead ?

  • 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-06-01T11:21:03+00:00Added an answer on June 1, 2026 at 11:21 am

    Just set the class of your object and provide a print method.

    class(mycomplexobject) <- c("too_complex", class(mycomplexobject))
    print.too_complex <- function(x) {
      cat("Complex object of length", length(x), "\n")
    }
    mycomplexobject
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

...just like packages do. I use Emacs (maybe, it can offer some kind of
Can someone offer some advice on how to get started with mathematica packages? I
Can anyone provide some information on how to run an integration services package, on
I have next package structure webService.ear -- dependency.jar -- some.class Can I remove some.class
For now, I need to use some packages to do a emulation for IOMMU
I'm using Linux Mint 11 64 bit. I needed some packages to install newest
I have one java project in netBeans. There are some packages, and classes in
What are some software packages available to provide 90% of the avatar functionality for
Is it possible in Eclipse to have some kind of packages (sets of projects)
I am having a strange issue with some of my packages in the same

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.