Displaying 20 results from an estimated 10000 matches similar to: "finding index of maximum value in vector"
2012 Dec 02
2
How to simulate correlated data
Hello there,
I would like to simulate X --Normal (20, 5)
Y-- Normal (40, 10)
and the correlation between X and Y is 0.6. How do I do it in R?
Thank you very much
-----
TO GET MORE DETAILS CLICK HERE
--
View this message in context: http://r.789695.n4.nabble.com/How-to-simulate-correlated-data-tp4651667.html
Sent from the R help mailing list archive at
2012 Dec 02
1
Linking C/C++ GUI to R.dll
Hi,
I am in the process of linking a C/C++ application to the R.dll
directly. I have obtained the R source code and compiled it
successfully. I have also successfully linked the R.dll directly into
our application and have made calls successfully into the R.dll that are
included in the sample rtest.c and in the "Writing R Extensions - The R
API".
The R functionality that we
2012 Nov 16
2
source file on startup question - why does an old version of a function show up? ggplot or R?
All,
1. I will try and make this clear and concise. Please let me know any
information that would be helpful in figuring out this problem (I don't
know the relevant information to post). I am on linux- see below for
session information.
2. Problem:
working directory: home
an old version of a function is sourced into the R session and doesn't work
working directory: Desktop
the
2008 May 08
2
Replicating Rows
Hi,
I have a data matrix in which there are 1000 rows by 30 columns. The first
column of each row is a numeric indicating the number of trips taken to a
particular location with location attributes in the following column entries for
that row.
I want to repeat each row based on the number of trips taken (as indicated by
the number in the first column)...i.e., if 1,1 indicates 4 trips, I want
2009 Apr 19
3
flip certain bits in vector
I have a string of binary values, and I would like to flip certain
bits in a set of positions.
Let's say the
vector p contains position [1, 3, 5, 7]
vector b contains bits [1, 0, 1, 0, 1, 0, 1, 0, 1, 0]
result r should be [0, 1, 0, 0, 0, 0, 0, 0, 1, 0]
in pseudo code this would be something like
---
r = c()
for (i in 1:10)
if (i in p)
r = c(r, flip[i])
r
----
2004 Jan 14
2
wich tools
Hello
I have two DSL modems witch are connected to my isp, in future my boss
want to buy another connection via DSL modem. Then i will have 3 DSL
modems. With every DSL modem i get 3x8 IP`s (netmask 248) from my ISP,
now i have question how to configure gateway wich tools should i use.
Because ip route and next hop via. wich i use now makes his work fine
but with new kernels there is an error
2008 Jun 23
3
expand.grid() function
Hi,
I have one question on expand.grid() function.
When I write following syntax :expand.grid(c("u", "l"), c("u", "l"), c("u", "l")) I get following as desired :
Var1 Var2 Var3
1 u u u
2 l u u
3 u l u
4 l l u
5 u u l
6 l u l
7 u l l
8 l l l
However
2011 Sep 21
7
Slow Directory Access after upgrade to 3.5.6
Upgraded to Samba 3.5.6 from 3.5.2.
Samba is running as a standalone server on a box that was upgraded from
Slackware 13.1 to Slackware 13.37.
All Win XP Pro and Win 7 Pro clients can connect to the workgroup and browse
shares and folders exactly as before; however, many complain of intermittent
pauses, slowdowns and "Not Responding" messages when traversing directories.
The samba server
2004 May 31
1
small question
Hello frieds,
do I need to do 'net rpc join -U Administrator'
(to selfjoin the localhost to the domain)
if I have samba3.0.4 running
in ROLE_DOMAIN_PDC and with ldapsam-Backend
and want to use winbindd for ntlm_auth squid authentification?
--
Best regards,
Malte mailto:malte.woelky@gmx.de
_________________
Malte Woelky -=[SkyNet]=-
2009 Nov 05
1
Typo in R Help INSTALL {utils} (PR#14045)
Full_Name: Neil Tiffin
Version: R version 2.10.0 (2009-10-26)
OS: [R.app GUI 1.30 (5511) i386-apple-darwin9.8.0]
Submission from: (NULL) (99.68.31.116)
In the help section 'INSTALL {utils}' half way down the page the line
Use R CMD INSTALL ?help for concise usage information, including all the
available options
should have two '-' in front of help. Therefor it should read
2010 Apr 20
1
multiple plots problem
hello,
i try to plot 3 graphs which have the same x.axis underneath each other. i'd
like the plots to be aligned without margings between the boxes and draw a
single x axis beneath the lowest plot.
i managed to get the alignment by setting par(mar), but the middle box is
stretched
and i cant't figure out how to get around this. par(pin) was my guess, but
this doesn't do the job
2006 Jan 24
3
Is there a concise way?
Hi,
Is there a concise/ruby way to do the following:
[Note: 1 and 2 below are not related.]
(1)
for p in 0...@order.line_items[k].shipment_lines.length
shipline_qty = shipline_qty +
@order.line_items[k].shipment_lines[p].quantity
end
(2)
ts = Array.new
for tk in s.trackings
ts.push(tk)
end
2012 Feb 19
2
barplot with more than 1 variable
Dear R listers,
I am trying to produce a simple (for a stata user) barplot with 4
countries on the x axis, each country observed in 2 subsequent years
and 3 variables.
Basically, I should have three bars for each year for each country. I
am attaching the chart I made in Stata, but I am not sure you'll
manage to see it!
I did the following:
#here I create the data-set TUSE2. The vectors mw, st
2010 May 26
4
More efficient way to use ifelse()?
# This is more about trying to find a more effecient way to code some
simple vectorized computations using ifelse().
# Say you have some vector representing a factor with a number of
levels (6 in this case), representing the location that samples were
collected.
Population <- gl( n=6, k=5,length=120, labels =c("CO", "CN","Ga","KO",
"Mw",
2017 Feb 01
2
RFC: Generic IR reductions
Hi All,
Renato wrote:
>As they say: if it's not broken, don't fix it.
>Let's talk about the reductions that AVX512 and SVE can't handle with IR semantics, but let's not change the current IR semantics for no reason.
Main problem for SVE: We can't write straight-line IR instruction sequence for reduction last value compute, without
knowing #elements in vector to
2004 Nov 18
5
How to calculate the stratified means in a data frame?
Dear R people,
I have a simple question to ask. Suppose I have a data.frame with two
variables: one factor (x) and one numeric (y), I want to calculate the
mean of y for each value of x. Although it's easy to do it within a
for a loop, I believe there may be a concise way by using some kinds
of "apply" functions. Could anyone tell me how to do that? Thank you.
Frank
2009 May 07
3
[PATCH] ocfs2_cluster_lock: code cleanup for redundant assignment
In fs/ocfs2/dlmglue.c:ocfs2_cluster_lock(), after label 'out:' the code is:
1373 if (wait && arg_flags & OCFS2_LOCK_NONBLOCK &&
1374 mw.mw_mask & (OCFS2_LOCK_BUSY|OCFS2_LOCK_BLOCKED)) {
1375 wait = 0;
1376 if (lockres_remove_mask_waiter(lockres, &mw))
1377 ret = -EAGAIN;
1378
2014 Sep 25
4
[LLVMdev] [cfe-dev] Commit message policy?
That seems mostly reasonable. I'd try to make it more concise, though. The
coding standards and developer policy docs should be short.
+Commit message
+--------------
+
+Although we don't enforce the format of commit messages, there are general
+guidelines that will help review, search in logs, email formatting and so
on.
+Mostly, the rules that apply are similar to other git
2003 Jun 13
1
lars - lasso problem
hello
I tried to use lars() but neither with my own data nor with the sample data it
works. I get in both cases the following error prompt:
> data(diabetes)
> par(mfrow=c(2,2))
> attach(diabetes)
> x<-lars(x,y)
Error in one %*% x : requires numeric matrix/vector arguments
> x<-lars(x,y, type="lasso")
Error in one %*% x : requires numeric matrix/vector arguments
2006 Aug 02
2
tcl/tk bind destroy event
Hello!
I want to create a messagebox whenever the user wants to destroy the window
(e.g. <Alt-F4> or the 'x' in the right top corner) and ask if a modified file
should be saved or not.
If 'cancel' is chosen then nothing should happen and the windows still should be
existing. This doesn't work. When I press cancel the window will be destroyed
although.
I also