Displaying 20 results from an estimated 300 matches similar to: "missing value where TRUE/FALSE needed"
2017 Nov 01
2
Function to save results
Hi,I want the results to be saved automatically in a output text file after the script has finished running.
I used the sink function in the following example, but the results file (output.txt) was empty.
net <- loadNetwork("C://Users//Priya//Desktop//Attractor analysis_all genes//synaptogenesis//regulationof_dopamine_signaling_submodule3.txt")# First I loaded theinput file for
2017 Nov 01
0
Function to save results
Some comments:
1. sink() does not return a value. There is on point to set attr <-
sink(...). Just give the command sink("C://....etc")
2. to complete the saving to the file you must give a second sink command
with no argument: sink()
So your code would be (pseudo-code, not actual code)
sink( "filename" )
do something that prints output which will be captured by sink
2017 Nov 01
2
Function to save results
Hi Eric,I tried as you suggested but I could not find the output in the text file I created (attr.txt)
net <- loadNetwork("C://Users//Priya//Desktop//Attractor analysis_all genes//synaptogenesis//regulationof_dopamine_signaling_submodule3.txt")sink("C://Users//Priya//Desktop//Attractor analysis_all genes//synaptogenesis//attr.txt")
sink()
attr <- getAttractors(net,
2017 Nov 01
3
Function to save results
Hi Eric,Thanks for the explanation. Is there a way to save the results automatically after the analysis gets over?. As I recently lost the results, because I didn't save the results. I don't want to run the sink or save command after the analysis is over rather run the command for saving the file before starting to run the analysis, so the file gets saved automatically after the script has
2017 Nov 01
0
Function to save results
Hi Priya,
You did not follow the logic of the pseudo-code.
The sink("filename"), sink() pair captures whatever output is generated
between the first sink statement and the second sink statement.
You need (possibly) to do:
sink("C://Users//Priya//Desktop//Attractor analysis_all
genes//synaptogenesis//attr.txt")
net <- loadNetwork("C://Users//Priya//Desktop//Attractor
2017 Nov 01
0
Function to save results
Let's try a simple example.
> # Create a script file of commands
> # Note we must print the results of quantile explicitly
> cat("x <- rnorm(50)\nprint(quantile(x))\nstem(x)\n", file="Test.R")
>
> # Test it by running it to the console
> source("Test.R")
0% 25% 50% 75% 100%
-2.4736219 -0.7915433
2005 Aug 03
4
R CMD build error
Dear list,
I try to update the prabclus package.
R CMD check works nicely, no warnings, good results in all tests.
However, building the package fails:
ginkgo:/disk5/home/chrish/RAusw/libsrc R CMD build prabclus
* checking for file 'prabclus/DESCRIPTION' ... OK
* preparing 'prabclus':
* checking whether 'INDEX' is up-to-date ... OK
* removing junk files
* building
2017 Nov 01
1
Function to save results
Hi David,Thank you for the example.When I try to use the cat function, I get an error
cat(attr<-getAttractors(net, type="asynchronous"))Error in cat(attr <- getAttractors(net, type = "asynchronous")) :
argument 1 (type 'pairlist') cannot be handled by 'cat'
Please let me know, if I have used the function in right way?.
Thank you
Priya
?
2003 Aug 04
3
Breusch-Godfrey Test
> Dear R Helpers!
>
> bgtest{lmtest} performs the Breusch-Godfrey test for higher
> order serial
> correlation.
>
> Is the Higher Order Correlation function already programmed in
> R I couldn't find it?
>
> Sergei Petrov
>
?acf
?pacf
HTH,
Bernhard
----------------------------------------------------------------------
If you have received this e-mail
2008 Jun 06
2
Merging two dataframes
Hi All,
Newbie question for you all but i have been looking at the archieves and the
help dtuff to get a rough idea of what i want to do
I would like to merge two dataframes together based on a keyed variable in
one dataframe linking to the other dataframe. Only some of the cases will
match but i would like to keep the others as well.
My dataframes have 67 and 28 cases respectively and i would
2009 Sep 15
2
Viewing Function Code
Hi All,
I'd like to see the function code behind the barplots2() function in the
gplots package, however i come across a bit of a stumbling block of a hidden
function, can anyone help?
> library(gplots)
> methods(barplot2)
[1] barplot2.default*
Non-visible functions are asterisked
> barplot2
function (height, ...)
UseMethod("barplot2")
<environment:
2008 Jun 17
2
Calling functions
Another newbie question.
I've written a function and saved the file as Xtabs.R, in a central place on
a network so others will be able ot use the function,
My question is how do i call this function?
I've tried to chance the working directory, and tried to load it via;
> library(Xtabs, lib.loc="//filer/common/technical/surveys/R_test")
but neither seem to work? the function
2011 Jun 23
2
Loading List data into R with scan()
Hi All,
I've been given a data file of the form:
1: 3,4,5,6
2:1,2,3
43: 5,7,8,9,5
and i want to read this data in as a list to create the form:
(guessing final look)
my.list
[[1]]
[1] 3 4 5 6
[[2]]
[1] 1 2 3
[[43]]
[1] 5 7 8 9 5
I can get to a stage using scan:
scan("my.data", what = character(0), quiet = TRUE)
to load
[1] "1: 3,4,5,6"
[2] "2:1,2,3"
[3]
2008 Dec 05
1
Loop swith String replacement
Hi All,
I'm trying to split my dataset, into multiple datasets that i'll analyse
later, i wanted to do this dynamically as i might need to rerun the code
later.
I was looking at doing this via a loop, (Are other methods more appropriate?
Would a function be better?)
However i'm not sure in R how do do string replacement within the loop in
order to create unique dataset names based on
2008 Jun 20
2
Problems with basic loop
I'm having trouble creating a looping variable and i can't see wher ethe
problem arises from any hep gratfully appreciated
First create a table
x<-table(SURVEY$n_0,exposed)
> x
exposed
False True
Under 16 24 1
16-19 68 9
20-24 190 37
25-34 555 204
35-44 330 87
45-54 198 65
55-64 67 35
65+
2009 Nov 10
2
Numeric formatting question
Hi All,
I have am using Sweave and the \Sexpr{} to place some numeric variables in
my tex document. I want to format the number prior to entry so they read
slightly more elegantly.
Say i have the following numbers
x <- 0.00487324
y <- 0.000000432
z <- 0.567
I would like to have the numbers displayed as follows
x1 <- 0.0049
y1 <- 0.00000043
z1 <- 0.57
I've seen i can use
2009 Aug 25
1
Help with nls and error messages singular gradient
Hi All,
I'm trying to run nls on the data from the study by Marske (Biochemical
Oxygen Demand Interpretation Using Sum of Squares Surface. M.S. thesis,
University of Wisconsin, Madison, 1967) and was reported in Bates and Watts
(1988).
Data is as follows, (stored as mydata)
time bod
1 1 0.47
2 2 0.74
3 3 1.17
4 4 1.42
5 5 1.60
6 7 1.84
7 9 2.19
8 11 2.17
I then
2008 Dec 31
3
Paste in a FOR loop
Hi All,
I've been having a little trouble using R2HTML and a loop, but can't figure
out where the problem lies, any hints gratefully received.
My code at the minute, (Which does work) is in the following:
library(R2HTML)
HTMLStart(outdir =
file.path("C://Example_work","R_projects","Dynamic_creative"),filename =
"RMDC_mockup",Title="Mock up for
2008 Aug 05
2
Selecting Variables
Hi All,
i have a dataset that i want to dynamically inspect for the number of
variables that start with "Exposure_" and then for these count the entries
across each case i.e
ID Exposure_1 Exposure_2 Exposure_3
1 y y y
2 y y -
3 y - -
So the corresponding new variables
2009 Oct 12
1
List mappings and variable creation
Hi All,
I have a questions about associative list mappings in R, and if they are
possible?
I have data in the form show below, and want to make a new 'bucket' variable
called combined. Which is the sum of the control and the exposed metric
values
This combined variable is a many to many matching as values only appear in
the file if they have a value > 0.
conversion.type filteredID