Why can't I load seqinr package in R? - r

I am learning R. I have install "seqinr package" successfully. But when I load the "seqinr" package, it is something wrong. Does anyone know how to resolve it?
enter image description here
I have tried to install package ade4,but it was shown like
enter image description here

Hopefully this helps the first part of your question.
For the seqinr package, I utilize the following code:
install.packages("seqinr")
#https://www.rdocumentation.org/packages/seqinr/versions/4.2-8
library(seqinr)
It seems old school but I always put the install and call for the library embedded within the code. Also are you using R Studio or just R? I have been dabbling in this same library myself.

Related

How to view mplus plots in r

I'm working on a project using programs r and Mplus. On Macs, the Mplus program doesn't allow you to load plots directly but it interfaces with r to do so. Sadly, I've followed the directions provided by the Mplus website but can't seem to locate the "source code" file that they casually refer to. I've searched my computer and the internet for an r file called "mplus.R" to no avail. Does anyone have experience with this?
Here are the two sources from Mplus I've been following:
https://www.statmodel.com/mplus-R/
http://www.statmodel.com/mplus-R/Mplus%20R%20tutorial.pdf
I've loaded the BiocManager package which is required to load the rhdf5 package but there are no functions for mplus listed in that second link. The answer must be in the mplus.R source code but I can't find it anywhere. Any help is much appreciated.
I found the source code right after sending off that question. I won't delete it incase someone might find this useful.
The mplus.R code required to view plots can be find in the first link posted in the question. It's under the section titled "The File mplus.R" but it must be copied and pasted into your r console or script and ran.

How to load self-written package documentation with '?my_package_name'?

I made a package in R called "my_package_name". When I run ?my_package_name or ??_my_package_name, no results are found. I want a help file to be loaded in the same way that ?ggplot2 loads a package help file.
I can run ?my_function_name to obtain the help files for my functions. However, this does not work with my package name, even though the description file is complete. I found that help(package = my_package_name) loads a page that contains the description file and help pages, but I would like load a page with ?my_package_name.
I would say that the easiest way is probably to run the following from the usethis package. It will create the file needed to have your package documentation
usethis::use_package_doc()
I suggest reading the documentation of the function to understand what's going on under the hood.

Why can R not find function "getStates"

I am trying to create a character map and was recommended to use Phylotools and Ape packages in R.
I have installed the packages but when I try to do function getStates it comes up with an error message:
x<-getStates(nexdata,"tips")
Error in getStates(nexdata, "tips") : could not find function "getStates"
I have installed the right packages (so I think) and I am quite stuck. Any help would be really appreciated. If you need me to explain anything in more detail let me know.
The function library() loads and attaches add-on packages. You are using phytools and ape, so you should have in your code
library(phytools)
library(ape)
You can read more in the documentation, e.g. at rdocumentation.org/packages/base/versions/3.6.1/topics/library.

How to use package `RcppExamples`?

I'm new to Rcpp and want to export some C++ class into R. I've install RcppExmples intending to learn some code snippet. But I didn't even know how to use it? help(RcppExamples) only to get:
Description:
This package shows some simple examples for the use of ‘Rcpp’.
Both the older ('classic') and new API are documented.
It can also serve as a working template to create packages that
use ‘Rcpp’ to interface C++ code or libraries.
Where can I get the examples?
The sources for the examples in the package are, well, in the package itself.
This is Rcpp. It works with C++ source code, and R code. You don't use this like a normal package, you create packages with it. From source.
Did you had a look at the manual? I think it's clear from this document. But the DESCRIPTION file says:
Note that the documentation in this package currently does not cover all the features in the package. It is not even close.
So I fear that's all you can get - besides looking at the source code.

How to see man page of a function of a user installed R library/package?

I have installed a library that contains lot of functions. I want to see calculations done in those functions. How to reach man page of these function in R prompt ?
I only know library(help="name of library") command to seek help.
The shortcut is:
?command
The longer version, for commands such as if for which the shortcut won't work, is:
help("command")
If you need to find a command in installed packages:
help.search("command")
If you need to find a command in all possible packages, the sos library is the ticket.
If you were using the ggplot2 package, go to google, type in something like :
'r ggplot2'
In the results look for the sites that look like this:
cran.r-project.org/package=ggplot2
and start with 'cran.r-project.org/....'
Click on that link and you will see a page for the package. You want to click on either the Reference Manual or for some packages there are Vignettes with more involved explanations and examples. However, the Reference Manual is usually pretty good for examples of how to use the package functions.

Resources