similar to: Data Frame as Hash Table

Displaying 20 results from an estimated 1000 matches similar to: "Data Frame as Hash Table"

2006 May 05
1
Sorting a hash
Quick Prototype.js hash question. Given: MyHash = {"Alpha" : {name:"Foo",val:3}, "Delta" : {name:"Bar",val:2}, "Beta" : {name:"Baz",val:4} } I want to display this set ordered by key - Alpha,Beta,Delta and by val - 2,3,4 Prototype.js helps with the hash: $H(MyHash).keys().sort() will give me Alpha, Beta, Delta but I''ve not
2011 Feb 27
10
How to store the same key multi times in a Hash ?
given an Arra tags[] I need to produce a resulting Hash as following .. { "$in" => [tags[0]], "$in" =>[tags[1], ...} in which the key should be always the same and the value being an Array I tried this : myHash = {} tags.each do |tag| h = {"$in" => [tag]} myHash.merge!(h) end but the merge! is only
2006 Jan 24
2
collect array values
This may be more of a Ruby question, but I wasn''t sure. Is there a way to run a find on a model and then save two fields as key => value in an array for each row. Then use this array on the template for checking if various checkbox or select values are checked? I''m trying to avoid running one query to check the value for each box in the form. - Kyle
2010 Apr 25
3
Determining Index of Last Element in Vector
Hi, Is there a way to specify the last element of a vector, similar to "end" in MATLAB? v[end] would be MATLAB for v(length(v)) in R. While `v(length(v))' does yield the last element, that approach fails in the following, rep(v, each=2)[-c(1,length(v))] which is meant to duplicate all elements of `v' except for the first and last. (I.e., if `v <- 1:4', then
2010 May 26
2
Avoiding Loops When Iterating Over Statement That Updates Its Input
Since `for' loops are slow in R, and since `apply' functions are faster, I was wondering whether there were a way to use an apply function?or to otherwise avoid using a loop?when iterating over a statement that updates its input. For example, here's some such code: r.seq <- 2 * (1 / d$Dt[1] - 1) for (i in 2:nrow(d)) { rf <- uniroot(bdt.deviation, interval=c(0, 1),
2023 Mar 18
2
Custom SASL authentication
An HTML attachment was scrubbed... URL: <https://dovecot.org/pipermail/dovecot/attachments/20230318/8ce3c29a/attachment-0001.htm>
2006 Apr 09
1
http request, hash table
Hello, My problem is that I cannot figure out how to format data in the http post request using external C++ application, so then I could write in my controller: @myHash = params[:person] print ''Name: '', @myHash[:name] or @name = params[:person][:name] Thanks in advance! -- Jakub P. Nowak
2006 Jun 18
4
share an hash ..
Hello, How to share an Hash between all objects (model, controller ect ...) => I did a static Hash in my model where a static method fill it basically, this is the code class Person < ActiveModel @@anHash.new def Person.anHelperMethod(aKey) if anHash.size==0 ... load the hash, some SQL to fill the Hash end return anHash[aKey] end => The problem,: it always
2006 Jul 10
11
prototype hash method
var v1 = { a: ''value for a'', b:''value for b'' } var v2 = { c: ''value for c'', d: function(){some code...} }; var v3 = v2.merge(v1); I''m getting an error doing this... what is wrong?
2013 Feb 28
2
Fortune?
I think the rule is that you can do anything as long as you don't complain. If you want to complain, you must follow the instructions. -- Jari Oksanen in Re: [Rd] Keeping up to date with R-devel -- Patrick Burns pburns at pburns.seanet.com twitter: @burnsstat @portfolioprobe http://www.portfolioprobe.com/blog http://www.burns-stat.com (home of: 'Impatient R' 'The R
2008 Nov 07
1
Updating Packages with Personal Library
I'm having trouble running `updates.packages()' and installing into a personal library. Setup: 1. .Renviron file contains: R_LIBS_USER="~/lib/R/%p-library/%v" 2. Hence "personal library" is: ~/lib/R/i486-pc-linux-gnu-library/2.6/ 3. Library path upon starting R: > .libPaths() [1] "/home/johnny/lib/R/i486-pc-linux-gnu-library/2.6" [2]
2010 Jul 04
1
arr.ind argument to which.min and which.max
Is there a reason that 'which.min' and 'which.max' don't have an 'arr.ind' argument? The context in which I wanted that was a grid search optimization, which seems like it would be reasonably common to me. -- Patrick Burns pburns at pburns.seanet.com http://www.burns-stat.com (home of 'Some hints for the R beginner' and 'The R Inferno')
2014 Jan 03
1
wishlist: decreasing argument to is.unsorted
I've just realized that it could be handy to have a 'decreasing' argument in 'is.unsorted'. And I'm cheekily hoping someone else will implement it. It is easy enough to work around (with 'rev'), but would be less hassle with an argument. The case I have in mind uses 'is.unsorted' in 'stopifnot'. Pat -- Patrick Burns pburns at pburns.seanet.com
2011 Sep 12
3
Solve your R problems
R-help is all about solving R problems. So here ya go: http://www.portfolioprobe.com/2011/09/12/solve-your-r-problems/ -- Patrick Burns pburns at pburns.seanet.com twitter: @portfolioprobe http://www.portfolioprobe.com/blog http://www.burns-stat.com (home of 'Some hints for the R beginner' and 'The R Inferno')
2010 Feb 12
1
Using seq_len() vs 1:n]
Pat Burns makes a good point. -Peter -------- Original Message -------- Subject: Re: [R] Using seq_len() vs 1:n Date: Fri, 12 Feb 2010 09:01:20 +0000 From: Patrick Burns <pburns at pburns.seanet.com> To: Peter Ehlers <ehlers at ucalgary.ca> References: <4B746AEF.10900 at ucalgary.ca> If you want your code to be compatible with S+, then 'seq_len' isn't going to work.
2010 Feb 25
24
two questions for R beginners
* What were your biggest misconceptions or stumbling blocks to getting up and running with R? * What documents helped you the most in this initial phase? I especially want to hear from people who are lazy and impatient. Feel free to write to me off-list. Definitely write off-list if you are just confirming what has been said on-list. -- Patrick Burns pburns at pburns.seanet.com
2006 Apr 19
2
how to pass a hash as a parameter in link_to_remote
When using link_to_remote, I''d like to pass along some auxiliary data in the request. It''s a hash of dynamic data that can change with each request. But I get an error when rails trying to "stringify" the hash. For the regular link_to, it works because it turns the hash into a regular GET-like query string. I''m expecting to be able to get my hash as
2008 Oct 24
1
Repetitive correlation test
Dear all, Through the following code, I wanted to perform correlation test repetedly (through loop) on different combinations of variables of a data set. Code: x=read.table("sample.txt",header=T,sep="\t") out="corout.txt" sink(out) nm = names(x) print(nm) nvr=3 # nvr=Total no. of variables in the input data file for (i in 1:(nvr-1)) { for(j in (i+1):nvr) { frm=
2010 Jun 20
6
Popularity of R, SAS, SPSS, Stata...
Hi All, I've been fiddling around with various ways to estimate the popularity of R, SAS, SPSS, Stata, JMP, Minitab, Statistica, Systat, BMDP, S-PLUS, R-PLUS and Revolution R. It's not an easy task. You can see what I've come up with so far at http://r4stats.com/popularity . I'm sure people will have plenty of ideas on how to improve this, so please let me know what you think.
2004 Jul 12
1
RE: tail(<matrix>) column numbers
I also vote for the 'helpful' addition on row numbers based on the original matrix when no row names are present, with an optional argument to prevent this behaviour. -G > -----Original Message----- > From: Duncan Murdoch [mailto:dmurdoch@pair.com] > Sent: Monday, July 12, 2004 8:06 AM > To: Patrick Burns > Cc: Martin Maechler; Warnes, Gregory R; Prof Brian Ripley; >