Displaying 20 results from an estimated 3000 matches similar to: "multiplying list with vector"
2012 Jan 16
3
list: index of the element, that is TRUE
Dear People,
I have got the following example for a vector and the index of the TRUE
element:
Myvector <- c(FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,TRUE)
which(Myvector)
Now I would like to find out the same for a list:
Mylist <- list(FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,TRUE)
...
Does anyone know how to do this?
Thank you very much in advance,
Marion
[[alternative HTML
2012 Jan 31
3
function: as.integer
dear r-helpers,
i created an object named A, which looks like this:
A <- c("4.4","1.9","4.1")
now i needed to get numbers instead of characters and for this i used the
function:
as.integer(A)
which resulted in:
[1] 4 1 4
My question is, why the numbers are rounded or more impotantly if
there is a way to keep the decimal numbers?
Thank you very much for
2012 Apr 12
3
Reading SPSS: underlying numerical codes
Dear people,
I have got a question concerning the underlying numerical codes when
reading an SPSS file into R.
I used the package foreign and when I look at a variable I get the verbal
codes.
I would like to know how it is possible to get the underlying numerical
codes as output, which are the same as in my SPSS file.
Thank you very much in advance for your help!
Marion
[[alternative HTML
2011 Sep 20
4
open source editor for r for beginners
Hello all,
I am looking for an editor for R which has got functions beyond the normal R
editor that is included in the program.
I had a look at VIM but I think it's difficult if you are just starting
programming.
Could anyone recommend an editor that is suitable for beginners?
Thanks for your help.
Marion
[[alternative HTML version deleted]]
2011 Sep 16
3
writing data from several matrices in R into one excel-file with several sheets
hello,
does anyone know how I can write several matrices from R into one exel-file
using different sheets for the different matrices?
thank you very much in advance for your help.
Marion
[[alternative HTML version deleted]]
2011 Sep 16
2
automatic selection of object without loop
Hello,
does anyone know the solution to this problem:
I imported a dataframe from Spss into R and saved it as an object called
"kinderrechte".
I have got the following command lines:
q1 <- kinderrechte[,"q0007_0001"]
l1 <- q0007_0001_l
now i would like to be able to change the column name in the first command
line (e.g. into q0007_0002) and to get R to automatically
2012 Jan 02
2
syntax for reading into R
dear users,
we have got the following question:
we have got a text-file looking like this:
...
<trkpt lat="48.272000" lon="16.342984">
<ele>387</ele>
<time>2012-01-01T15:32:03Z</time>
<sat>9</sat>
</trkpt>
<trkpt lat="48.271909" lon="16.343563">
<ele>381</ele>
2012 Jul 24
3
package memisc: recode examples
Dear people,
Yesterday I looked at the recode command in the memisc package and ran the
following example stated in the manual:
x <- as.item(sample(1:6,20,replace=TRUE),
labels=c( a=1,
b=2,
c=3,
d=4,
e=5,
f=6))
print(x)
f <- as.factor(x)
f
recode(f,
2011 Sep 19
2
pasting elements of one character vector together
hello,
i am familiar with the paste command with which i can paste for exaple:
object <- "Hello"
paste(object,"World")
now i would like to be able to paste all the elements of the same vector
together e.g:
object <- c("Hello","World")
getting as a result also:
"Hello World".
Does anyone know the solution to this problem?
Thank you
2012 Feb 14
2
save objects of own function to workspace
Dear R-helpers,
I created an own function which looks like this
s_elternmz <- function(Var="balt")
{
Dg_a<-mz[,c("asbhh","apkz",Var)]
colnames(Dg_a)[colnames(Dg_a)=="apkz"]<-"bpkzm"
colnames(Dg_a)[colnames(Dg_a)==Var]<-paste(Var,"_m",sep="")
2011 Sep 15
1
Courses in R
Hello,
I have a question concerning courses in R in *Vienna, Austria*.
Does anyone know where courses in R are offered, that you can do after
having attended a course for the basics?
Thanks in advance for your help.
Marion
[[alternative HTML version deleted]]
2011 Oct 11
2
binding all elements of list (character vectors) to a matrix as rows
dear r-users,
i have got a problem which i am trying to solve:
i have got the following commands:
Mymatrix <- matrix(1:9,ncol=3)
Z <-
list("V1"=c("a","",""),"V2"=c("b","",""),"V3"=c("c","",""),"V4"=c("d","",""))
Mymatrix <-
2012 Feb 20
3
Run function several times changing only one argument - without a loop
Dear people,
I created a plot which looks like this:
Ee1<-matrix(c(88,86,74,62,41),ncol=5)
colnames(Ee1)<-c("Lehrer","Lehrerinnen","Klassenkollegen","Klassenkolleginnen","Geschwister")
par(las=1)
par(mar=c(5,13,4,2))
barplot(Ee1,horiz=T,col="grey85",border="NA",xlim=c(0,100),axes=F)
axis(2,pos=10, tick=T, tcl=F,
2012 Feb 16
2
import .csv file into R
Dear r-helpers,
I read a .csv file into R
with the following command:
A<-read.csv2(file="Mappe3.csv")
It worked fine, except that I would like to get rid of the points between
the words and get spaces instead like I have got in the .csv file.
At the moment it looks like the following:
habe.mich.gut.mit.KlassenkollegInnen.verstanden
hatte.gutes.Verhältnis.zu.Eltern
2012 May 31
1
maptools: using to sets of information (within two shape files) for one plot
Dear all,
I am using a shape file containing the information regarding the borders of
the PARISHES of Austria. I created a plot with different colours for
different percentages of child care institutions.
Now I would like to add the information of the COUNTY boundaries to this
plot which I have got in another shape file. I would like these boundaries
to be shown with bold lines so that they can
2012 Mar 10
2
Window on a vector
Dear all,
I have a large vector (lets call it myVector) and I want to plot its value with the logic below
yaxis<-myVector[1]
yaxis<-c(xaxis,mean(myvector[2:3])
yaxis<-c(xaxis,mean(myvector[4:8])
yaxis<c(xaxis,mean(myvector[9:16])
yaxis<c(xaxis,mean(myvector[17:32])
this has to stop when the new ..... yaxis<c(xaxis,mean(myvector[1024:2048]) will not find the correspondent number
2008 Nov 06
2
Fwd: SWIG with R and C++ STL
Hi, all
I didn't get any response from swig for my question.
see if I can get some help here
Thanks
---------- Forwarded message ----------
From: charlie <charlie.xia.fdu@gmail.com>
Date: Tue, Nov 4, 2008 at 1:55 PM
Subject: SWIG with R and C++ STL
To: swig-user@lists.sourceforge.net
Hi all,
I am new to SWIG. I encountered some problem when I try to SWIG to R some
C++ modules.
Here
2007 Dec 18
6
All anchored series from a vector?
>From: Johannes Graumann <johannes_graumann at web.de>
>Date: 2007/12/18 Tue PM 04:40:37 CST
>To: r-help at stat.math.ethz.ch
>Subject: [R] All anchored series from a vector?
lapply(1:length(myvector) function(.length) {
c(myvector[1}:myvector[.length])
})
but test it because i didn't.
>Hi all,
>
>What may be a smart, efficient way to get the following result:
2009 Feb 15
1
Overloading in R
I have been trying to write a new class that reimplements the vector
class. As a test of my overloading I decided to try and and call
t.test on two vectors which were objects of my class rather than the
default class.
The overloaded length I wrote seems to work correctly. I used
setMethod("length", "myvector", ...)
setMethod("mean", "myvector", ...)
2013 Aug 27
1
R Language Newbie
Hi,
set.seed(29)
myVector<- rnorm(100)
?seq(1,100,by=2)
# [1]? 1? 3? 5? 7? 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49
#[26] 51 53 55 57 59 61 63 65 67 69 71 73 75 77 79 81 83 85 87 89 91 93 95 97 99
myVector[seq(1,100,by=2)]
rev(myVector)
?sum(myVector>0)
#[1] 46
#or
?table(myVector>0)
#
#FALSE? TRUE
?#? 54??? 46
A.K.
Hey guys, this is my first week