Displaying 20 results from an estimated 2000 matches similar to: "Reshaping data"
2010 Mar 23
2
Transform data set
Dear R Experts,
I am having some trouble creating a variable in R. I have data on
self-placement of voters, their placement of parties, and which party
they feel closest to. The data is structured like this:
Party_Close lrplaceself lrplaceParty1 lrplaceParty2 ...
party1 2 4 5
party2 5 6 4
party1 6 2 1
etc...
I want to format the data set so it looks like this:
Party_Close
2010 Apr 23
3
Event History Data Recoding
Dear R list,
I have an event history data set that is structured like this:
Legislative act Discussion Agreement Time Event
Act1 2006-05-30 2006-06-19 20 1
Act2 2004-03-01 2004-06-14 105 1
.
.
.
I have information on the meetings in the legislature between adoption
periods in a separate variable (the
2010 Mar 30
2
Create a new variable
Dear R-list,
Sorry for spamming the list lately, I am just learning the more advanced
aspects of R!
I have some data that looks like this:
Out Country1 Country 2 Country 3 ... CountryN
1 1 1 1 1
0 1 1 0 1
1 1 0 1 0
I want to create a new variable that counts the number of zeros in every
row whenever Out is equal to 1, and else it is a zero, so it would look
like this:
new_var
0
0
2
I
2010 Mar 29
5
Finding common an unique elements in character vectors
Dear R-list,
I have a problem which I think is quite basic, but so far google has not
helped me.
I have two vectors like this:
vector_1 <- c(Belgium, Spain, Greece, Ireland, Luxembourg, Netherlands,
Portugal)
vector_2 <- c(Denmark, Luxembourg)
I would like to find the elements in vector_1 that are not in vector_2
so that i get a vector with these countries: Belgium, Spain, Greece,
2017 Oct 15
2
Download data from NASA for multiple locations - RCurl
Dear David,
This is amazing, thank you so much. If I may ask another question:
The output looks like the following:
###
dput(head(x,15))
c("Metadata for Requested Time Series:", "",
"prod_name=GLDAS_NOAH025_3H_v2.0",
"param_short_name=Tair_f_inst", "param_name=Near surface air temperature",
"unit=K",
2017 Oct 15
0
Download data from NASA for multiple locations - RCurl
> On Oct 15, 2017, at 2:02 PM, Miluji Sb <milujisb at gmail.com> wrote:
>
> Dear all,
>
> i am trying to download time-series climatic data from GES DISC (NASA)
> Hydrology Data Rods web-service. Unfortunately, no wget method is
> available.
>
> Five parameters are needed for data retrieval: variable, location,
> startDate, endDate, and type. For example:
2017 Oct 16
0
Download data from NASA for multiple locations - RCurl
> On Oct 15, 2017, at 3:35 PM, Miluji Sb <milujisb at gmail.com> wrote:
>
> Dear David,
>
> This is amazing, thank you so much. If I may ask another question:
>
> The output looks like the following:
>
> ###
> dput(head(x,15))
> c("Metadata for Requested Time Series:", "", "prod_name=GLDAS_NOAH025_3H_v2.0",
>
2006 Sep 22
2
I''m misunderstanding how stubs works
We''re still just starting out with Mocha/Stubba, so please forgive any
newbie errors.
I''m using "stubs" to test some realtime functions, to control exactly which
time is returned from Time.now. I would expect the following test to pass:
def test_two_stubs
t = Time.now - 60
Time.stubs(:now).returns(t)
start_time = Time.now
t += 20
2006 Sep 25
3
Engine Yard blog
Just received the news from Tom Mornini.
Congrats Ezra for the new Engine Yard site and the blog you will be
collaborating.
Hope to read you there soon.
http://www.engineyard.com/
Jonathan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/backgroundrb-devel/attachments/20060925/3f251fa4/attachment.html
2017 Oct 16
1
Download data from NASA for multiple locations - RCurl
I have done the following using readLines
directory <- "~/"
files <- list.files(directory)
data_frames <- vector("list", length(files))
for (i in seq_along(files)) {
df <- readLines(file.path(directory, files[i]))
df <- df[-(1:13)]
df <- data.frame(year = substr(df,1,4),
month = substr(df, 6,7),
day =
2014 Feb 21
5
[LLVMdev] interesting LLVM code optimization issue regarding timer registers
This problem was reported to me by a friend who has an LLVM port that is
not put back to open source.
Essentially, there is an intrinsic call _lr which is a load register.
so then user code has something like:
start_time = _lr(TIMER_REGISTER)
.....
some_code_to_time
....
end_time = _lr(TIMER_REGISTER)
So what happens is that LLVM moves the code as follows:
start_time = _lr(TIMER_REGISTER)
2010 Jan 29
3
Vector from Matrix
Dear Mailing List Members,
the problem I've been grappling with für quite some time now is the following:
I have a 100 rows x 200 columns matrix.
data.set <- matrix(rnorm(20000, 100, 200))
Now I would like to get a vector of length 100 which collects the values from the following procedure:
Take the sum of the minima of the two values from each row of columns 1 and 101, and divide it
2019 Jun 07
1
Problem with opusfile & ndk
Hi Xiph.org Team.
We are using opusfile library <https://github.com/xiph/opusfile> for
streaming *.opus* audio in our projects.
But now we have a problem with building opusfile library for android with
*ndk-build*.
In particular, with arm64-v8a platform: Google removed <sys/timeb.h> from
android.
And now building opusfile with nkd-build crashes with error "fatal error:
2017 Oct 15
2
Download data from NASA for multiple locations - RCurl
Dear all,
i am trying to download time-series climatic data from GES DISC (NASA)
Hydrology Data Rods web-service. Unfortunately, no wget method is
available.
Five parameters are needed for data retrieval: variable, location,
startDate, endDate, and type. For example:
###
2017 Sep 13
2
compounding precipitation based on whether falls within a day
Using the small reproducible example below, I'm wondering how best to
complete the following task:
In the small reproducible example below, the 3D array prec has indexes that
correspond to time, x, y (i.e., prec[time, x, y]). In this case, the time
index is hours since some predefined start time. I'd like to add up all
the time indexes in 'prec' based on whether or not the
2008 Apr 02
2
Stopping a function execution automatically after a given time
Dear all,
I often need to execute functions repeatedly (thousands or more times).
While doing so, I encounter two types of problems:
1.) In some models, the estimation process fails due to convergence problems
2.) Some models will run forever.
My solution to #1 is to use tryCatch around the function call so that my
script does not stop if one of the models will raise an error. This works
fine.
2009 Mar 07
1
Cdr problem
hi,
I'm working with asterisk on a project and I found a problem with cdr_odbc.
As we know, after answering each call a cdr event is raised which is saved
in cdr_csv and cdr_odbc. but here my point is on cdr_odbc. some information,
including start_time and end_time is given by cdr event but the problem is
that these two information(start_time and end_time) is not getting save in
cdr_odbc. I
2017 Sep 13
0
compounding precipitation based on whether falls within a day
Thanks for the reprex. Wouldn't have bothered without it.
The following is I believe **almost** what you want. It seems a bit clumsy
to me, so others may provide you something neater. But anyway...
## Convert POSIXct vector to dates
## There are 22 different days, not 21
date <- as.Date(prec_idx)
## Sum results by date at each i,j of the last 2 array dimensions
z <-
2007 Oct 19
2
Name length of function argument? (PR#10357)
Hi,
I've just been programming a function to calculate the likelihood in a
probit model.
The function looks like this
likelihood <- function(Y,X,p) {
Z <- p[1] +p[2]*X
P <- Y*pnorm(Z) + (1-Y)*(1-pnorm(Z))
-prod(P)
}
out <- optim(likelihood,p=c(0,0),Y=wells$switch,X=wells$dist, hessian=TRUE)
X and Y are vectors containing column data.
This works fine, however, if I rename p to
2015 Oct 20
1
[PATCH v3 07/13] v2v: factor out copying of output data
Factor out copying the overlays to final disk images into a separate
function.
Signed-off-by: Roman Kagan <rkagan@virtuozzo.com>
---
v2v/v2v.ml | 227 +++++++++++++++++++++++++++++++------------------------------
1 file changed, 114 insertions(+), 113 deletions(-)
diff --git a/v2v/v2v.ml b/v2v/v2v.ml
index afffde2..703038c 100644
--- a/v2v/v2v.ml
+++ b/v2v/v2v.ml
@@ -110,121 +110,9 @@ let