Displaying 20 results from an estimated 400 matches similar to: "Table to List Transformation Scenario"
2008 Jul 31
2
S 3 generic method consistency warning please help
I would like to include this in a package. The S3 methods on R CMD check
says
* checking S3 generic/method consistency ... WARNING
window:
function(x, ...)
window.chron:
function(data, day1, hour1, day2, hour2, ...)
See section 'Generic functions and methods' of the 'Writing R Extensions'
manual.
I have looked and can not figure it out. This function is for convience.
What
2012 Jan 19
1
converting a for loop into a foreach loop
Dear all,
Just wondering if someone could help me out converting my code from a for()
loop into a foreach() loop or using one of the apply() function. I have a
very large dataset and so I'm hoping to make use of a parallel backend to
speed up the processing time. I'm having trouble getting selecting three
variables in the dataset to use in the foreach() loops. My for() loop code
is:
2009 Jul 08
3
#INCLUDE
What is R's equivalent to a C-like #include to incorporate external files. I
have a 2k line function that is generated and need to include it at runtime
but not manage it as a package (as it changes hourly.) Any ideas?
[[alternative HTML version deleted]]
2009 Aug 12
4
paste first row string onto every string in column
Hi,
I am trying to edit a data frame such that the string in the first line is
appended onto the beginning of each element in the subsequent rows. The data
looks like this:
> df
V1 V2 V3 V4
1 DPA1* DPA1* DPB1* DPB1*
2 0103 0104 0401 0601
3 0103 0103 0301 0402
.
.
and what I want is this:
>dfnew
V1 V2 V3 V4
1 DPA1* DPA1* DPB1* DPB1*
2 DPA1*0103
2009 Jul 21
4
list of lm() results
How can I get the results of lm() into a list so I can loop through the results?
e.g.
myResults[1] <- lm(...)
myResults[2] <- lm(...)
myResults[3] <- lm(...)
...
myResults[15] <- lm(...)
myResults[16] <- lm(...)
so far every attempt I've tried doesn't work throwing a "number of
items to replace is not a multiple of replacement length" error or
simply not
2013 Jan 17
1
plotting from dataframes
thanks to your guys help I am closer to solving my problem but I have some
small problem. So let's say I start with
>data
number day hour
1 17 10
2 17 11
3 17 6
4 18 4
5 18 10
6 19 8
7 19 8
I want to split to odd days, which I am able to do, I call this object
frames, which looks like:
> frames
$`1`
c1 day1 hour1
1 1 17 10
2 2 17 11
3 3 17 6
$`2`
c1 day1
2008 Jan 24
2
boxplot axis labelling
Hi,
i'm very new to R, so sorry for what i'm sure is a very basic question. I'm
producing a boxplot with the data below:
df3<-data.frame(
x=c(10,11,115,12,13,14,16,17,18,21,22,23,24,26,27,28,29,3,30,32,33,34,35,4,4
1,45,5,50,52,56,58,6,67,6738,68,7,8,9),
fq=c(8,11,1,2,4,4,2,2,6,3,4,2,2,1,1,1,4,51,3,1,1,1,1,35,1,1,19,2,1,1,1,14,1,
1,1,10,13,5),
2017 Nov 01
3
Adding Records to a Table in R
Dear R friends,
I am currently working with time series data, and I have a table(as data
frame) that has looks like this (TransitDate are in format = "%e-%B-%Y") :
TransitDate Transits CargoTons
1985-04-01 100 2500
1985-05-01 135 4500
1985-06-01 120 1750
1985-07-01 100 3750
1985-08-01 200
2006 Mar 16
6
Newbie question - Rails without database
Hello to all,
I am entirely new to Ruby and also to Ruby on Rails. As far as I understand,
Rails builds its model according to the a specified table structuree in in the
database.
However, most of my applications, are for the most part (except some backend
CRUD stuff) not database centric. They do a lot of calculation for the user.
So, how can I create a model, when no database is needed,
2017 Nov 01
0
Adding Records to a Table in R
Hi Paul,
#First I set up some sample data since I don't have a copy of your data
dtOrig <- as.Date( c("1985-04-01","1985-07-01","1985-12-01","1986-04-01"))
dfOrig <- data.frame( TransitDate=dtOrig, Transits=c(100,100,500,325),
CargoTons=c(1000,1080,3785,4200) )
#Generate the complete set of dates as a data frame
dfDates<- data.frame(
2008 May 03
1
recode involving a count rule
Hello, R-helpers.
I have a data frame below called df. I want to add a variable c, based on
the following logic:
if df$a < 5 then the first two times this condition is met place a 1 in c,
the next two times this condition is met place a 2 in c and when the
condition is not met let c equal df$b. The result would look like, dfnew,
shown below.
a <- rep(c(3,5,7), 4)
b <- rep(c(NA,1,2),
2017 Jan 03
2
Vorbis encoding at half speed
I’m using a Windows development component which uses vorbis.dll, ogg.dll, vorbisenc.dll for encoding an Ogg Vorbis file. It's all working well except for one user occasionally has a 1 hour file appear as 2 hours and it plays at half speed. It is being converted from stereo to mono before feeding the encoder with a channels=1 configuration.
Here is an example file which will be available for
2004 Jul 16
2
where to sign up for fwd
Could someone please point me to the proper url to register for a fwd
acount and get a fwd number. I couldn't find it at
www.freeworlddialup.com or fwd.pulver.com
Thanks,
-Galt
--
"They that would give up essential liberty for temporary safety deserve
neither liberty nor safety."
Benjamin Franklin
2013 Apr 09
4
Converting matrix to data frame without losing an assigned dimname
Hello All,
Would like to be able to convert a matrix to a dataframe without losing an assigned dimname.
Here is an example that should illustrate what I'm talking about.
tableData <- state.x77[c(7, 38, 20, 46), c(7, 1, 8)]
names(dimnames(tableData)) <- c("State", "")
tableData
State Frost Population Area
Connecticut 139 3100 4862
2017 Nov 08
3
Adding Records to a Table in R
Dear Eric,
Hope you are doing great. I also tried the following:
#First I created the complete date sequence
TransitDateFrame <- data.frame(TransitDate=seq(as.Date(dataset1[1,1]),
as.Date(dataset1[nrow(dataset1),1]), by = "month"))
#Then I did the merging
dataset1NEW <- merge(TransitDateFrame, dataset1, by="TransitDate",
all.x=TRUE)
Now it has, as expected the
2010 Feb 17
3
Extending data frame with longer columns
Hi,
I am a beginner in R and have only read a few chapters in the R book,
I was not able to find a solution for this simple problem.
I have an empty data frame:
a=data.frame(name="test")
which I would like to extend in a for-loop (with data extracted from a
database). Ideally I would like to extend the data frame like this:
a["new_1"] = 1:10
a["new_1"] = 1:12
2009 Jul 15
2
Spaces in a name
I am reading regressors from an excel file (I have no control over the file)
and some of the element names have spaces:
i.e. "Small Bank Aquired"
but I have found that lm(SourceData ~ . - "Small Bank Aquired", mcReg)
doesn't work (mcReg = modelCurrentRegressors)
As they are toggles I have ran them through factor() to be treated propertly
as 0 or 1 but due to the fact I
2009 Jul 21
2
Odd coefficent behavior
Why are my coefficients getting appended with a 1? It borks a match I
do later against the original list that doesn't have the random 1
added to the end.
> linearModel[[1]]
Call:
lm(formula = modelSource ~ +UNITBUILD + UNITDB + ITBUILD + ITDB +
UATBUILD + UATDB + HOGANCODE + RCF + ReleaseST1 + ReleaseST2 +
ReleaseBLA + Small.Bank.Acquisitions + HLY.NewYear + HLY.MLK +
HLY.PRES +
2011 Jan 16
3
transform a df with a condition
Dear all,
for each A == 3 in 'df' I would like to change the variables B and K.
My result should be the whole df and not the subset (A==3)...
df <- data.frame(A = c(1,1,3,2,2,3,3),
B = c(2,1,1,2,7,8,7),
K = c("a.1", "d.2", "f.3",
"a.1", "k.4", "f.9",
2004 Jul 14
1
looking for 802.11 SIP phone
While I have found a few 802.11 cordless SIP phones, It's not ovious
how they select which network to associate with. What I'm looking for
is a 802.11 SIP phone that will auto detect the closest wireless
network(s), offer a list to select from, then auto configure itself
using dhcp. If you think about it this could be quite handy when
strolling around in populated areas. Could someone