Displaying 20 results from an estimated 30000 matches similar to: "how to append element at last position in array dynamically"
2012 Feb 22
2
how to make hash?& append element, if i want following condition
i want hash like
A : 1.2, 3.4, 4.5
B : 9.7, 5.6, 4.8
C : 3.4 ,5.7, 4.6
where A key contain all three value at right sight
how to append single keys & values if i have predefined hash with known
length
--
View this message in context: http://r.789695.n4.nabble.com/how-to-make-hash-append-element-if-i-want-following-condition-tp4409761p4409761.html
Sent from the R help mailing list
2012 Feb 06
1
appending variable's values in table like fashion
i have two variable
> pyar
[1] "M" "12" "34" "13"
> gita
[1] "U" "22" "33" "44"
want to append gita object below pyar object as
& want to take in anther variable
"M" "12" "34" "13"
"U" "22" "33" "44"
& write it in
2012 Feb 04
2
want to drop levels of table vector & join two vector(appending)
is have vector from table stored in s variable
> s
[1] R P Y A C P V E S C D R R F S R S A D L T R H I R I
Levels: A C D E F G H I K L M N P Q R S T V Y
--
View this message in context: http://r.789695.n4.nabble.com/want-to-drop-levels-of-table-vector-join-two-vector-appending-tp4356851p4356851.html
Sent from the R help mailing list archive at Nabble.com.
2008 Mar 15
1
How to get the value of last element in a vector/array ?
Hi,
a[length(a)] gives the value of last element. Is there an alternative
without using functions ?
[[alternative HTML version deleted]]
2007 Nov 24
1
ragged array with append
I wonder what's the right way in R to do the following -- placing
objects of the same kind together in subarrays of varying length.
Here's what I mean:
> word <- c("a","b","c","d","e","f","g","h","i","j")
> kind <- c(1,1,1,2,3,4,5,5,7,7)
> d <-
2011 Dec 29
3
Array element is function of its position in the array
I want to create a new array which selects values from an original array
based on a function of the indices. That is:
I want to create a new matrix Vnew[i,j,k]=Vold[i,j,ks] where ks is a
function of the index elements i,j,k. I want to do this WITHOUT a loop.
Call the function "ksfunction", and the array dimensions nis,njs,nks. I can
do this using a loop as follows:
# Loop version:
2012 Feb 05
2
how to avoid writing index in write.table command
how to avoid writing index of variable in write.table command,
e.g. output--->
index,character,state
"1" "M" "2"
"2" "K" "3"
"3" "R" "1"
"4" "E" "1"
"5" "S" "1"
"6" "H" "1"
"7" "K" "1"
2008 Jul 07
2
A shorter version of ".Last.value"?
Hi,
There is an object, ".Last.value" to which the result of the most recent
evaluation is assigned. This is similar to "ans" in Matlab. In Matlab
"ans" can be very useful and time-saving, but typing the larger R
version is somewhat clunky and takes away from the usefulness.
Is it possible to reassign '.Last.value' to something simpler, like
2012 Mar 31
2
Is it there any std pattern in R which show same representation style of ppt found on net
i m searching on net,material related to R,
whenever i get ppt presentation of some topic ,i found it in speical format
white backgroud & blue bars,having links for further topics
see link
1) https://www.rmetrics.org/files/Meielisalp2007/Presentations/Pfaff.pdf
2)http://grapevine.com.au/~yanchang/docs/Time-Series-Mining-slides.pdf
If this is format,how can i made it,if i want to give my R
2012 May 26
6
how to check given number seq. is time series or not?
i have following numbers
0.889046409368551
1.22726162946495
1.22726162946495
1.35785109728356
1.35785109728356
1.10704609982913
1.4424189950435
1.2277843378837
1.35785109728356
0.970883941918588
0.822170913920467
1.35785109728356
0.358815782262543
0.774234247460432
0.822170913920467
0.822170913920467
0.72599976881814
0.671583894425946
2011 Apr 22
2
writing/appending a text file
Hello
I'm fairly new to R. I have a script which produces a 1-column vector
(numeric). I can write it to a text file using the write command. What I
want to do is to run the script a number of times on different input files,
producing a different 1-column vector each time and save all the vectors to
a text file so that each vector is one separate column in the text file. I
had thought of
2011 Jan 17
3
to append a column to a data frame, has I use loop/if in my case?
days=Sys.Date()-1:70
price=abs(rnorm(70))
regular=rep(c(0,0,0,0,1,0,1,0,0,1),c(7,7,7,7,7,7,7,7,7,7))
y=data.frame(cbind(days,price,regular))
y is like
days price regular
1 14990 0.16149463 0
2 14989 1.69519358 0
3 14988 1.57821998 0
4 14987 0.47614311 0
5 14986 0.87016180 0
6 14985 2.55679229 0
7 14984 0.89753533 0
the output I want:
2012 Mar 07
2
how to see inbuilt function(cor.test) & how to get p-value from t-value(test of significance) ?
i can see source code of function
> cor
function (x, y = NULL, use = "everything", method = c("pearson",
"kendall", "spearman"))
{
na.method <- pmatch(use, c("all.obs", "complete.obs",
"pairwise.complete.obs",
"everything", "na.or.complete"))
2023 Dec 29
1
Help request: Parsing docx files for key words and appending to a spreadsheet
checkout the 'officer' package
Thanks
Jim Holtman
*Data Munger Guru*
*What is the problem that you are trying to solve?Tell me what you want to
do, not how you want to do it.*
On Fri, Dec 29, 2023 at 10:14?AM Andy <phaedrusv at gmail.com> wrote:
> Hello
>
> I am trying to work through a problem, but feel like I've gone down a
> rabbit hole. I'd very much
2007 Oct 30
4
append to static array (was: Re: Why External Node Classification is my future)
On 10/29/07, Luke Kanies <luke@madstop.com> wrote:
> On Oct 29, 2007, at 2:35 PM, Brian Finney wrote:
> > Although iteration would be really cool if we could also append to an
> > array in a global fashion, but thats a completely different dream.
>
> What do you mean?
Thinking some thing like:
# define for simple firewall control
define port($port, $status){
push
2009 Aug 21
1
Appending elements according to criteria to an empty array
Hi all R users,
I am trying to extract elements from an array (x as shown below) where the
difference between the consecutive elements does not equal 1.
The desired output is:
j = 6,17,27,38,58,69,79,90
However, the code below only returns:
j = 1,69,79,90
I am assuming that "cbind" function is not extracting all the elements
meeting the condition. In
2012 Mar 15
2
how to bind uneven column (not equal length) into matrix without recycling values
i have
> x
[1] 1 2 3 4 5 6
> y
[1] 34 5 6
> z<-cbind(x,y)
> z
x y
[1,] 1 34
[2,] 2 5
[3,] 3 6
[4,] 4 34
[5,] 5 5
[6,] 6 6
i don't want recycling, instead can we put NA /0 like below> z
x y
[1,] 1 34
[2,] 2 5
[3,] 3 6
[4,] 4 NA
[5,] 5 NA
[6,] 6 NA
& want distance matrix
--
View this message in context:
2012 Apr 21
1
how to write html output (webscraped using RCurl package) into file?
i want
"http://scop.berkeley.edu/astral/pdbstyle/?id=d1fjgc2&output=html",showing
information in webpage to be written in .txt file as it is(i don't want any
html tag)
i am using "RCurl" package
>marathi<-htmlTreeParse("http://scop.berkeley.edu/astral/pdbstyle/?id=d1fjgc2&output=html")
>marathi
2012 Apr 22
2
how to avoid newlines & tabs in file opening?
i have uploaded file,but when i am opening it in R,using
> u<-file(file.choose(),"r")
>k<-readLines(u)
>k
> k[1:120]
is has all /t (tabs)& newlines, how to avoid it,
can i take first 3 columns only in table form (lines starts with # not
important for me)
uploaded file:-
http://r.789695.n4.nabble.com/file/n4577757/rabata.txt rabata.txt
--
View this message in
2011 Dec 01
1
efficient ways to dynamically grow a dataframe
Hi,
I'm trying to write a small microsimulation in R: that is, I have a
dataframe with info on N individuals for the base-year and I have to
grow it dynamically for T periods:
df = data.frame(
id = 1:N,
x =....
)
The most straightforward way to solve the problem that came to my mind
is to create for every period a new dataframe:
for(t in 1:T){
for(i in 1:N){
row = data.frame(
id =