Displaying 20 results from an estimated 20000 matches similar to: "different functions on different vector subsets"
2005 Sep 27
3
Dummy quesion about environment
Hi,
I'm trying to understand environment object in R.
I used the example:
f <- function(x) {
y <- 10
g <- function(x) x + y
return(g)
}
h <- f()
h(3)
then i saw that f return an environment
> h
function(x) x + y
<environment: 01B28570>
but I coudn't access to x and y object in that environment:
I tried
2003 May 01
1
rotate plot
Dear group members,
I am trying to plot two adjacent plots using layout function. One plot is scatter plot and the other is density plot. However, I would like that the density plot would be present horizonaly in respect to the scatter plot.
| |
| |
| |
|
2003 Jun 16
1
grid background color
Dear all,
I am trying to run cloud function in lattice library under r-1.7, and I wlways get gray background. I've tried to chang it by set "...par.box=list(col="white")"
or by gpar(background="white") but no result.
How do i do it?
Thanks in advance,
Ron
2003 Jul 13
1
bootstrap for hclust
dear group members,
I am looking for a function that assess the stability of cluster. The result of hclust function is an hclust object which can be plot as a dendrogram. However to have confidence in the tree topology usualy bootstap is applied. I understand that I can apply bootstarp on the original data and then run hclust(dist() ) as much as I resampled but how to comapre the topologies the I
2003 Feb 08
1
mirroring R
Dear supporter,
Can you tell me please how can I mirroring R at our site? One of the reasons I would like to do this is the fact that it is impossible to update R behind our firewalls.
Thank in advance
Ron Ophir, Ph.D.
Bioinformatician,
Biological Services
Weizmann Institute of Science
POB 26
Rehovot 76100
Israel
e-mail: Ron.Ophir at weizmann.ac.il
Phone: 972-8-9342614
Fax:972-8-9344113
2004 Nov 30
1
about the subscript assignment porblem
Hi, Dear,
I have a problem for the new version 2.0 of R
When I put this code in it give me the error:
uis$ivhx3[uis$ivhx>0] <- 1*(uis$ivhx==3)
Error: NAs are not allowed in subscripted assignments
but this would happen in version 1.91
there are missing data in the data set and it is
represented as NA
the data set can be find on line
at the ucla web
actually this is a example from its
2003 Jan 26
1
R2HTML
Dear group members,
I am trying to install R2HTML on PC, but keep getting the following error message:
Error in testRversion(descfile) : This package has not been installed properly
See the Note in ?library
Can any help me with this?
thanks in advance,
Ron
[[alternate HTML version deleted]]
2009 Jan 08
1
NAs are not allowed in subscripted assignments
Browse[1]> j <- c(1,2,NA)
Browse[1]> j[j==1][-1]
[1] NA
Browse[1]> j[j==1][-2]
[1] 1
Browse[1]> j[j==1][-2] <- 2
Error during wrapup: NAs are not allowed in subscripted assignments
As far as I can see, I have no NA in the lhs (not after the second
subscript anyway).
Besides, I have a single value on the rhs, so it should be allowed to
have NAs in the lhs, according to
2007 Sep 02
2
NAs in indices
Hi All,
I'm fiddling with an program to read a text file containing periods that
SAS uses for missing values. I know that if I had the original SAS data
set instead of a text file, R would handle this conversion for me.
Data frames do not allow missing values in their indices but vectors do.
Why is that? A search of the error message points out the problem and
solution but not why they
2004 Sep 23
3
R glm
Hello:
would you please help me with the following glm question?
for the R function glm, what I understand is: once you specify the
"family", then the link function is fixed.
My question is: is it possible I use, for example, "log" link function,
but the estimation approach for the guassian family?
Thanks,
Shuangge Ma, Ph.D.
********************************************
*
2009 Dec 02
4
sort a data frame by a vector
Hi,
I have a a vector and a data frame with two columns
vec = c("C", "A", "B")
dataDF = data.frame(A1 = c("B", "A", "C"), A2 = c(1,2,3))
I would like to sort the data frame by column A1 such that the order of
elements in A1 is as the same as in vec.
After the ordering, the data frame would be
A1 A2
C
2013 Jan 21
4
missing values are not allowed in subscripted assignments of data frames
Ein eingebundener Text mit undefiniertem Zeichensatz wurde abgetrennt.
Name: nicht verf?gbar
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20130121/317d3f7b/attachment.pl>
2013 Jul 07
2
The *tmp* variable
When complex assignments are performed, the R interpreter creates, then
removes a special variable *tmp*. However, when byte compiling is enabled,
it seems that a different mechanism for making compound assignments is used.
Would it be possible to eliminate *tmp* from interpreted R code as well? It
might be useful for a function to lock its own environment, and the
appearance and disappearance of
2018 May 23
3
find the permutation function of a sorting
> sort(c("bc","ac","dd"), index.return=TRUE)
$x
[1] "ac" "bc" "dd"
$ix
[1] 2 1 3
We have the permutation, namely 1-->2, 2-->1, 3-->3.
How can I apply the permutation function to a new set
c("D","E", "F")?
so that the result is
c("E","D", "F").
2018-05-23 11:06
2002 Feb 14
1
Subsets in mclust
Dear group,
I want to use the mclust package on large data, and therefore I want to use
a subset in the initial clustering phase. From help(mclust):
k: If `k' is specified, the hierarchical clustering phase will
use a sample of size `k' of the data in the initial
hierarchical clustering phase. The default is to use the
entire data set.
m2 is a
2008 Nov 20
4
Fitting a sine wave using solver
Greetings,
I have several sets of oscillation data and would like to estimate the
parameters of a sine function to each set (and hopefully automate
this). A colleague provided an excel sheet that uses solver to minimize
the RSS after fitting the sine function to each data set, but this
cumbersome and difficult to automate. Is there a method in R for
fitting a given sine function to a
2011 Jul 14
1
Amelia_Multiple_Imputation_with_observational_priors_noms
I am fairly new at using R/programming in general so I apologize if I am
leaving crucial parts of the puzzle out, but here goes.
First and foremost this is the error I am receiving:
Error in muPriors[priors[, 1:2]] <- priors[, 3] :
NAs are not allowed in subscripted assignments
This occurs only when I am using observational priors and some number of
nominal variables, it does not
2012 Feb 11
1
Asterisk perl AGI confusing variables
Hello all,
I'm struck with a very strange problem today. I've an AGI with some code
subroutine snippet as follows:
sub enable_sbc($) {
my $carrier = shift;
my $tmp = substr($carrier,1);
my $jkh = $tmp;
$server_port = $ast_agi->get_variable("SIPPEER($jkh,port)");
$ser_ip = $ast_agi->get_variable("SIPPEER($tmp,ip)");
2018 May 23
3
find the permutation function of a sorting
Thanks, David.
I got the answer from the web.
Is there any easy way to permute a set (e.g., a set of characters) by the
permutation it returns? Thanks,
> x <- c(10,7,4,3,8,2)
> sort(x, index.return=TRUE)
$x
[1] 2 3 4 7 8 10
$ix
[1] 6 4 3 2 5 1
2018-05-23 10:49 GMT+08:00 David Winsemius <dwinsemius at comcast.net>:
>
>
> > On May 22, 2018, at 10:06 PM, John
2018 May 23
2
find the permutation function of a sorting
Hi,
Is there any way to find the permutation function of the sorting and to
apply the function (or its inverse) elsewhere?
For example, the following permutation function from the sorting in the
matrix form is
c(1,2,3), c(2,1,3)
> sort(c("bc","ac","dd"))
[1] "ac" "bc" "dd"
I try to find it in the permutations/permute