Displaying 20 results from an estimated 5000 matches similar to: "Substitute value"
2013 Feb 01
2
Nested loop and output help
Hello Everyone,
My name is Thomas and I have been using R for one week. I recently found
your site and have been able to search the archives of posts. This has
given me some great information that has allowed me to craft an initial
design to an inquiry I would like to make into the breakdown of McNemar's
test. I have read an intro to R manual and the posting guides and hope I am
not violating
2010 Jul 21
1
xtable with ifelse statement
Hi there,
I'm very new on R and I hope someone can help me to solve the problem in
using the ifelse statement with the xtable function(library xtable).
I'm trying to get the printing of the elements of two lists in a sorted way.
These two list have in common the their names.
I will try to give an example:
the first list looks like this:
$code1
Code code1
Nation
2010 Jul 18
2
Namibia becoming NA
I have a data file in which one of the columns is country code and NA is the
code for Namibia.
When I read the data file using read.csv, NA for Namibia is being treated as
null or "NA"
How can I prevent this from happening?
I tried the following but it didn't work
input <- read.csv("padded.csv",header = TRUE,as.is = c("code2"))
thanks,
Suresh
[[alternative
2011 Feb 24
4
Running code sequentially from separate scripts (but not functions)
Hello!
I am wondering if it's possible to run - in sequence - code that is
stored in several R scripts.
For example:
Script in the file "code1.r" contains the code:
a = 3; b = 5; c = a + b
Script in the file "code2.r" contains the code:
d = 10; e = d - c
Script in the file "code3.r" contains the code:
result=e/a
I understand that I could write those 3 scripts
2009 Nov 10
1
Data transformation
Dear all,
I have a dataset as below:
id code1 code2 p
1 4 8 0.1
1 5 7 0.9
2 1 8 0.4
2 6 2 0.2
2 4 3 0.6
3 5 6 0.7
3 7 5 0.9
I just want to rewrite it as this (vertical to horizontal):
id var1 var2 var3
2007 Feb 22
2
[LLVMdev] opt -verify
I am writing an interprocedural compiler pass. Because the passneeds
information from a FunctionPass, e.g., the post-dominance frontier
(PDF), and because a ModulePass is not permitted to require a
FunctionPass, I am forced to make my pass a FunctionPass and do majority
of its work in the doFinalization() method.
When I run "opt -mypass -verify -o code2.bc code1.bc" I get no
2007 Feb 22
3
[LLVMdev] opt -verify
I followed what you said and called verifyModule() with the
AbortProcessAction option. verifyModule() returns false, but does not
abort and does not print out any information about what caused the
verification to fail.
Chris Lattner wrote:
> On Wed, 21 Feb 2007, Ryan M. Lefever wrote:
>> I am writing an interprocedural compiler pass. Because the passneeds
>> information from a
2007 Feb 22
0
[LLVMdev] opt -verify
I also tried iterating through the functions of the module and calling
verifyFunction(), which also returns false, but does not cause an abort
or report anything to stderr about what caused the verification to fail.
From the doxygen for verifyFunction() and verifyModule(), it seems
like they both should print information to stderr if the verification
fails and should abort opt if
2011 Oct 19
1
Square ended segments
Good Afternoon R Community,
I am working on plotting behavior codes over short durations of time (a few seconds at a time over 1-2 hrs). I am utilizing as.POSIXct to store the time. I wanted to make a quasi time line using these time. I utilized the segments function to represent these times. However the segments rounds off at the ends and does not have the crisp look I need for my purposes.
2007 Feb 22
0
[LLVMdev] opt -verify
On Wed, 21 Feb 2007, Ryan M. Lefever wrote:
> I am writing an interprocedural compiler pass. Because the passneeds
> information from a FunctionPass, e.g., the post-dominance frontier
> (PDF), and because a ModulePass is not permitted to require a
> FunctionPass, I am forced to make my pass a FunctionPass and do majority
> of its work in the doFinalization() method.
ok
> When
2011 Feb 03
1
Getting variable names in function output
Dear R-users,
I would like to have some advises about a problem illustrated by the
following snippet. Within myf, I need to evaluate a piece of R code that is
passed as a character argument and then return the objects that are created
by this code. The difficulty comes from the fact that the content of the
code is variable and unknown to me (obviously not in this illustration!).
With the
2007 Jul 23
1
CHAR(STRING_ELT( - OK but CHAR(asChar(STRING_ELT( - not, why?
Any idea why CHAR(asChar(STRING_ELT( produces NA whereas
CHAR(STRING_ELT( gets a pointer to a string? It's generally expected
that STRING_ELT should already be a character, but why the coercion does
not work? Here is a simple example (consistent over R2.5.1-R2.6 rev
42284, I didn't check earlier versions, but it used to be different in
2.4):
install.packages("inline")
2007 Feb 22
1
[LLVMdev] opt -verify
I think I misread the doxygen. verifyFunction & verifyModule return
false if no errors are detected. However, my question now becomes why
does the code produced by my transform pass verification, but it causes
an assertion failure in the byte reader when it (the code produced by my
transform) is passed to another invocation of opt?
Ryan M. Lefever wrote:
> I also tried iterating
2004 Aug 25
1
brlr function
Hi,
I'm trying the brlr function in a penalized logistic regression function.
However, I am not sure why I am encountering errors. I hope to seek
your advice here. (output below)
Thank you! Your help is truly appreciated.
Min-Han
#No error here, the glm seems to work fine
>
2008 Jul 14
2
Backslash in sub pattern?
Dear guRus,
I am trying to replace "~" by "$\sim$" for TeX. However, I can't get the
backslash to work. I would like to turn "DV~IV" into "DV$\sim$IV".
sub("~","$\sim$","DV~IV") => "DV$sim$IV"
sub("~","$\\sim$","DV~IV") => "DV$sim$IV"
2010 Oct 20
3
Plot help
Dear List,
I am relatively new to R and am trying to create more attractive plots than excel can manage!
I have looked through the various programmes ggplot, lattice, hmisc etc but my case seems to be not metnioned, maybe it is but i have not noticed - if this is the case i apologise.
2005 Apr 13
1
i param in "for" loop does not takes zeros?
Hi all
Is there any reason why the parameter i in a "for" loop ignores a value of
zero? For example
sim=c()
p=.2
for(i in 0:5)
{sim[i]=dbinom(i,5,p)
}
sim
[1] 0.40960 0.20480 0.05120 0.00640 0.00032
In this example the quantile i= 0 was ignored since
dbinom(0,5,p)
[1] 0.32768
The same behaviour occurs if I use a while loop to perform the same
calculation:
sim=c()
p=.2
i=0
2019 May 15
1
domain still running although snapshot-file is deleted !?!
Hi,
i have a strange situation:
A domain is still running where domblklist points to a snapshot file and also dumpxml says the current drive is that snapshot file.
But the file has been deleted hours ago. And the domain is still running. I can login via ssh, the database and the webserver are still running,
domain is performant.
How can that be ?
Also lsof shows that the file is deleted:
2006 Jan 13
1
Variance-covariance by factor
Dear all,
I have a data frame with one factor and four numeric variables and
wish to obtain the var-cor matrix separately by factor. I tried by() and
sapply() but getting nowhere. I understand this can be done by subsetting
the dataframe, but there should have some sleek ways of doing it.
Here is a simulated dataframe;
s <- rep(c("A","B","C"), c(25,22,18))
d
2017 Oct 31
2
Help with Nesting
How do i resolve this?
symbol <- c('RRR' ,'GGG')
for(i in seq_along(symbol)) {
dat <- Quandl("LLL/symbol[i]")
}
required solutionis a loop where Quandl is a function and it loops as flows,
Quandl("LLL/RRR")
Quandl("LLL/GGG")